Assert

Assert(false)

The system will throw out a exception.

使用assert的缺点是,频繁的调用会极大的影响程序的性能,增加额外的开销。

在调试结束后,可以通过在包含#include的语句之前插入 #define NDEBUG 来禁用assert调用,示例代码如下:

 

 

In VS, if you want to build a release branch, the compile will not find the definition of assert()

原文地址:https://www.cnblogs.com/gaoxianzhi/p/4439610.html