19#define NDA_RUNTIME_ERROR throw nda::runtime_error{} << "Error at " << __FILE__ << " : " << __LINE__ << "\n\n"
21#define NDA_ASSERT(X) \
22 if (!(X)) NDA_RUNTIME_ERROR << AS_STRING(X);
24#define NDA_ASSERT2(X, ...) \
25 if (!(X)) NDA_RUNTIME_ERROR << AS_STRING(X) << "\n" << __VA_ARGS__;
37 std::stringstream acc;
40 mutable std::string _what;
75 (*this) << std::string(mess);
83 const char *
what() const noexcept
override {
const char * what() const noexcept override
Override the virtual function what from std::exception to retrieve the accumulated error message.
runtime_error() noexcept
Default constructor.
~runtime_error() noexcept override=default
Default destructor.
runtime_error(runtime_error const &err) noexcept
Copy constructor to copy the contents of the error message accumulator.
runtime_error & operator<<(const char *mess)
Accumulate error message.
Macros used in the nda library.