Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Stack Of Tasks
pinocchio
Commits
98735e92
Commit
98735e92
authored
Oct 16, 2019
by
Wolfgang Merkt
Browse files
Add runtime assert with message
parent
6e7bec22
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/macros.hpp
View file @
98735e92
...
...
@@ -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__)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment