27struct userErr :
public virtual std::runtime_error {
28 using std::runtime_error::runtime_error;
31 using std::runtime_error::runtime_error;
34 using std::runtime_error::runtime_error;
36using logicErr = std::logic_error;
39#if defined(MANIFOLD_ASSERT) && defined(MANIFOLD_DEBUG)
42void AssertFail(
const char* file,
int line,
const char* cond,
const char* msg) {
43 std::ostringstream output;
44 output <<
"Error in file: " << file <<
" (" << line <<
"): \'" << cond
45 <<
"\' is false: " << msg;
46 throw Ex(output.str());
50void AssertFail(
const char* file,
int line,
const std::string& cond,
51 const std::string& msg) {
52 std::ostringstream output;
53 output <<
"Error in file: " << file <<
" (" << line <<
"): \'" << cond
54 <<
"\' is false: " << msg;
55 throw Ex(output.str());
60#define DEBUG_ASSERT(condition, EX, msg) \
61 if (!(condition)) AssertFail<EX>(__FILE__, __LINE__, #condition, msg);
64#define ASSERT(condition, EX) \
65 if (!(condition)) throw(EX);
67#define DEBUG_ASSERT(condition, EX, msg)
68#define ASSERT(condition, EX)
Definition optional_assert.h:33
Definition optional_assert.h:30
Definition optional_assert.h:27