You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, one must decide at compile time whether PPK_ASSERT will use a static bool _ignore flag or not (see: PPK_ASSERT_DISABLE_IGNORE_LINE).
However, I have a program that largely should use that bool, but can't in certain places.
The place where it is not allowed is inside a constexpr function.
ppk_assert.h line 243 col 23: error: ‘_ignore’ declared ‘static’ in ‘constexpr’ function
So, it would be nice if there were some PPK_ASSERT_NOSTATE(...) set of macros that could be used in this case, even if the normal PPK_ASSERT(...) macros do keep state.
The text was updated successfully, but these errors were encountered:
Even though you manage to use PPK_ASSERT in a constexpr function, I don't get how this composes with the fact that the handling part is designed to happen at runtime 🤷♂️
Yes, I take your point, and maybe PPK_ASSERT is just a runtime-only facility.
I went down this path because I can use plain assert() in my constexpr functions. Having done some research, this is a C++14-specific thing. Even though it is constexpr, it will fail at runtime when the condition is met (at least, I just tried this on GCC 8.3).
So, maybe this request is a bit outside the scope of PPK_ASSERT.
I just thought it would be nice to take advantage of all the other machinery that PPK_ASSERT provides, handling various arguments, etc. But if it all boiled down to plain assert it could be used in a constexpr function on C++14.
Currently, one must decide at compile time whether
PPK_ASSERT
will use astatic bool _ignore
flag or not (see:PPK_ASSERT_DISABLE_IGNORE_LINE
).However, I have a program that largely should use that bool, but can't in certain places.
The place where it is not allowed is inside a
constexpr
function.eg:
This fails to compile for me, with:
So, it would be nice if there were some
PPK_ASSERT_NOSTATE(...)
set of macros that could be used in this case, even if the normalPPK_ASSERT(...)
macros do keep state.The text was updated successfully, but these errors were encountered: