From 49d18e6b8a95f6ae4755cacd958248ffbdbf59ff Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Fri, 7 Oct 2022 11:00:05 +0200 Subject: a --- compat/assert.hpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'compat') 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); \ -- cgit v1.2.3