32#define NDA_RUNTIME_ERROR throw nda::runtime_error{} << "Error at " << __FILE__ << " : " << __LINE__ << "\n\n"
34#define NDA_ASSERT(X) \
35 if (!(X)) NDA_RUNTIME_ERROR << AS_STRING(X);
37#define NDA_ASSERT2(X, ...) \
38 if (!(X)) NDA_RUNTIME_ERROR << AS_STRING(X) << "\n" << __VA_ARGS__;
50 std::stringstream acc;
53 mutable std::string _what;
88 (*this) << std::string(mess);
96 const char *
what() const noexcept
override {
Runtime error class used throughout the nda library.
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.