Commit 98735e92 authored by Wolfgang Merkt's avatar Wolfgang Merkt
Browse files

Add runtime assert with message

parent 6e7bec22
......@@ -21,9 +21,9 @@
#include <exception>
/// \brief Macro to check an assert-like condition and throw a runtime error exception (with a message) if violated.
#define PINOCCHIO_ASSERT_THROW_AT_RUNTIME(cond) if (!(cond)) { throw std::runtime_error("Wrong argument size"); }
#define PINOCCHIO_ASSERT_THROW_AT_RUNTIME(cond, message) if (!(cond)) { throw std::runtime_error(message); }
// #define PINOCCHIO_ASSERT_THROW_AT_RUNTIME(cond) void(0);
#define PINOCCHIO_ASSERT_THROW_AT_RUNTIME_WITH_MESSAGE(cond, message) if (!(cond)) { throw std::runtime_error(message); }
// For more details, visit https://stackoverflow.com/questions/171435/portability-of-warning-preprocessor-directive
#if defined(__GNUC__) || defined(__clang__)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment