26struct userErr :
public virtual std::runtime_error {
27 using std::runtime_error::runtime_error;
30 using std::runtime_error::runtime_error;
33 using std::runtime_error::runtime_error;
35using logicErr = std::logic_error;
38void AssertFail(
const char* file,
int line,
const char* cond,
const char* msg) {
39 std::ostringstream output;
40 output <<
"Error in file: " << file <<
" (" << line <<
"): \'" << cond
41 <<
"\' is false: " << msg;
42 throw Ex(output.str());
46void AssertFail(
const char* file,
int line,
const std::string& cond,
47 const std::string& msg) {
48 std::ostringstream output;
49 output <<
"Error in file: " << file <<
" (" << line <<
"): \'" << cond
50 <<
"\' is false: " << msg;
51 throw Ex(output.str());
56#define DEBUG_ASSERT(condition, EX, msg) \
57 if (!(condition)) AssertFail<EX>(__FILE__, __LINE__, #condition, msg);
60#define ASSERT(condition, EX) \
61 if (!(condition)) throw(EX);
63#define DEBUG_ASSERT(condition, EX, msg)
64#define ASSERT(condition, EX)
Definition optional_assert.h:32
Definition optional_assert.h:29
Definition optional_assert.h:26