2008年6月26日星期四

how to use assert

[how to use assert]

For performance-critical code, runtime checks such as uses of assert can impose a
significant performance penalty. In these cases, you can compile your code with the
NDEBUG macro defined, by using the -DNDEBUG flag on your compiler command line.
With NDEBUG set, appearances of the assert macro will be preprocessed away. with NDEBUG flag on, all assert will be taken off.

0 意見: