diff options
author | levine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-12-09 14:59:45 +0000 |
---|---|---|
committer | levine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-12-09 14:59:45 +0000 |
commit | b41dc02c60214b03a9092c591f4cc4423e259036 (patch) | |
tree | f31326d84fa033bb2ce8fd12e8e4db16bbf7ab15 | |
parent | 4074a7e72c1f75de68a380228d19b4c24599b473 (diff) | |
download | ATCD-b41dc02c60214b03a9092c591f4cc4423e259036.tar.gz |
added ACE_ASSERT example
-rw-r--r-- | docs/ACE-guidelines.html | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/docs/ACE-guidelines.html b/docs/ACE-guidelines.html index 5239bd57c83..291e2612846 100644 --- a/docs/ACE-guidelines.html +++ b/docs/ACE-guidelines.html @@ -711,7 +711,20 @@ bgcolor="#ffffff"> <li>Be <em>very</em> careful with <code>ACE_ASSERT</code>. It must only be used to check values; it may never be used to wrap a function call, or any other statement. That's because - the statement will disappear when ACE_NDEBUG is enabled.<p> + the statement will disappear when ACE_NDEBUG is enabled. For + example, this code is BAD: + <pre> + ACE_ASSERT (this->next (retv) != 0); // BAD CODE! + </pre> + + Instead, the above should be coded this way: + + <pre> + int result = this->next (retv); + ACE_ASSERT (result != 0); + ACE_UNUSED_ARG (result); + </pre> +<p> </ul> |