diff options
-rw-r--r-- | src/include/span.hpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/include/span.hpp b/src/include/span.hpp index 86d21514..881c34df 100644 --- a/src/include/span.hpp +++ b/src/include/span.hpp @@ -69,3 +69,4 @@ Spanned<T> make_spanned(Span sp, T val) { #define BUG(span, msg) do { ::Span(span).bug([&](::std::ostream& os) { os << msg; }); throw ::std::runtime_error("Bug fell through"); } while(0) #define TODO(span, msg) do { const char* __TODO_func = __func__; ::Span(span).bug([&](::std::ostream& os) { os << "TODO: " << __TODO_func << " - " << msg; }); throw ::std::runtime_error("Bug (todo) fell through"); } while(0) +#define ASSERT_BUG(span, cnd, msg) do { if( !(cnd) ) { ::Span(span).bug([&](::std::ostream& os) { os << "ASSERT FAIL: " #cnd << ": " << msg; }); throw ::std::runtime_error("Bug fell through"); } } while(0) |