C++ 一个简洁的CHECK宏
#include <iostream>
#include <stdlib.h>
#define CHECK2(condition, message) \
(!(condition)) ? (std::cerr << "Assertion failed: (" << #condition << "), " \
<< "function " << __FUNCTION__ << ", file " << __FILE__ << ", line " << __LINE__ << "." << std::endl \
<< message << std::endl, \
abort(), 0) \
: 1
// CHECK2(condition, "message: " << var);