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

posted on 2015-04-19 18:36  shoutcharter  阅读(121)  评论(0编辑  收藏  举报

导航