Wednesday 25 July 2012

cassert Library

<cassert>

Provides a debugging function for testing conditions where all instances can be turned on or off at once. assert(false); prints the asserted expression, source code file name, and line number, then aborts. Compiling with g++ -DNDEBUG effectively removes these statements.
assert(e); // If e is false, print message and abort
#define NDEBUG // (before #include <assert.h>), turn off assert

No comments:

Post a Comment