diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2022-10-07 11:00:05 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2022-10-07 11:00:05 +0200 |
commit | 49d18e6b8a95f6ae4755cacd958248ffbdbf59ff (patch) | |
tree | 910f1c47b71bbd14595750185bffac15a4fdfe48 /compat | |
parent | 7740c71ecedd90f9b465dc35994e64915dbda826 (diff) |
a
Diffstat (limited to 'compat')
-rw-r--r-- | compat/assert.hpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/compat/assert.hpp b/compat/assert.hpp index 81d5d4ab..8383d333 100644 --- a/compat/assert.hpp +++ b/compat/assert.hpp @@ -41,6 +41,13 @@ namespace Magnum::Examples { } \ } while(false) +#define ASSERT_EXPR(var, expr, cond) \ + [&] { \ + decltype(auto) var = (expr); \ + ASSERT(cond); \ + return (var); \ + }() + #define GAME_DEBUG_OUT(pfx, ...) ([&]() { \ if constexpr (sizeof((pfx)) > 1) \ std::fputs((pfx), stderr); \ |