ENSURES usage removed

This commit is contained in:
Nekotekina 2016-08-14 22:41:01 +03:00
parent b0f5796c90
commit 1f3433464c
9 changed files with 17 additions and 24 deletions

View file

@ -58,14 +58,12 @@
#define HERE "\n(in file " __FILE__ ":" STRINGIZE(__LINE__) ")"
// Wrap an expression into lambda
// Wrap an expression into lambda. Obsolete.
#define WRAP_EXPR(...) [&] { return __VA_ARGS__; }
// Ensure that the expression is evaluated to true. Always evaluated and allowed to have side effects (unlike assert() macro).
// Ensure that the expression is evaluated to true. Obsolete.
#define VERIFY(...) do { if (!(__VA_ARGS__)) fmt::raw_error("Verification failed: " #__VA_ARGS__ HERE); } while (0)
// EXPECTS() and ENSURES() are intended to check function arguments and results.
// Expressions are not guaranteed to evaluate.
#define EXPECTS(...) do { if (!(__VA_ARGS__)) fmt::raw_error("Precondition failed: " #__VA_ARGS__ HERE); } while (0)
#define ENSURES(...) do { if (!(__VA_ARGS__)) fmt::raw_error("Postcondition failed: " #__VA_ARGS__ HERE); } while (0)