5/16/08

Describe MFC's ASSERT, VERIFY, and DEBUG_NEW macros.

ASSERT and VERIFY are very similar, differing in only one respect. Both macros take an
expression as a parameter and cause an exception if the expression evaluates to FALSE.
The only difference is that ASSERT does nothing in release builds, whereas VERIFY works
in both debug and release code.

DEBUG_NEW replaces calls to the new operator, performing the same service but also
recording the file name and line number where each new statement occurs. This can help
locate the cause of memory leaks resulting from a failure to match a new statement with
a delete statement.

No comments: