首页 > 其他 > 详细

Assert

时间:2015-04-19 19:18:14      阅读:184      评论:0      收藏:0      [点我收藏+]

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

Assert

原文:http://www.cnblogs.com/gaoxianzhi/p/4439610.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!