I need to know whether NDEBUG is defined when specifying the noexcept specifier. I was thinking along the lines of this constexpr function:
constexpr inline bool is_defined() noexcept
{
return false;
}
constexpr inline bool is_defined(int) noexcept
{
return true;
}
Then use it like:
void f() noexcept(is_defined(NDEBUG))
{
// blah, blah
}
Does the standard library or the language already provide a facility for this so that I won't be reinventing the wheel?