17 # define FUNCTION_SIG __FUNCSIG__
18 #elif defined(__GNUC__)
20 # define FUNCTION_SIG __PRETTY_FUNCTION__
22 static_assert(
false,
"Incompatible compiler");
36 #define THROW_EXCEPTION(exception_type, message) throw exception_type(FUNCTION_SIG, message)
47 #define THROW_EXCEPTION_IF(condition, exception_type, message) \
48 if (condition) [[unlikely]] \
49 THROW_EXCEPTION(exception_type, message)
85 Exception(
const std::string& origin,
const std::string& message);
125 : std::runtime_error{std::string(
"[") + origin + std::string(
"] ") + message}
Exception class for failed memory allocations.
Definition: exception.h:92
Exception(const std::string &origin, const std::string &message)
Constructor.
Definition: exception.h:124
Base exception class that stores origin and message of an exception.
Definition: exception.h:65
Exception class for errors that do not fit into any other category.
Definition: exception.h:100
Exception class that should be throwm if an invalid value is detected.
Definition: exception.h:108