<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
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