#include <iostream>
#include <assert.h>
using namespace std;
int main() {
assert(1 == 0);
assert(false);
cout << "we got here" << endl;
return 0;
}
使用上面的代码,we got here
被输出到控制台窗口。
另外,我注意到 assert 被定义为:
#define assert(expression) ((void)0)
不再精通 C/C++,而 CUDA C 也差不多。