12 #ifndef HAMMER_EXCEPTIONS
13 #define HAMMER_EXCEPTIONS
23 class Error :
public std::runtime_error {
26 Error(
const std::string& message) noexcept : runtime_error(message) {
81 const char *condition,
88 #define ASSERT_MSG(x, msg) do{ \
90 Assert::HandleAssert(msg, #x, __FILE__, __LINE__); \
95 #define ASSERT(x) do{ \
97 Assert::HandleAssert("Assertion!", #x, __FILE__, __LINE__); \
102 #else // Disabled Asserts
104 #define ASSERT(x) do { (void)sizeof(true); } while(0)
106 #define ASSERT_MSG(x, msg) do { (void)sizeof(true), (void)sizeof(msg); } while(0)
PhaseSpaceError(const std::string &message) noexcept
IndexLabelError(const std::string &message) noexcept
InitializationError(const std::string &message) noexcept
Invalid phase space point error class.
Error(const std::string &message) noexcept
Initialization error class.
Invalid index label error class.
Error & operator=(const Error &)=default
RangeError(const std::string &message) noexcept
void HandleAssert(const char *message, const char *condition, const char *fileName, long lineNumber)
virtual ~Error() noexcept
Out-of-range error class.