Requiring pure/const expressions in assertions
The GCC `__attribute__((pure))` and `__attribute__((const))` allow functions to be declared as non&ndash;side-effecting and referentially transparent, respectively; let's say I want to write `pure_assert` and `const_assert` macros, whose argument must be an expression of the appropriate level of strictness, that is:

    assert(oops_a_side_effect());

Silently results in different behaviours in debug and release, but:

    pure_assert(oops_a_side_effect());
    const_assert(oops_read_a_global());

Would be a compile-time error, at least in debug builds. For what I should hope are obvious reasons, you can't just create a `pure_assert_impl` declared `__attribute__((pure))` and have the macro expand to it. So is it possible to write these macros?
Requiring pure/const expressions in assertions
===

The GCC `__attribute__((pure))` and `__attribute__((const))` allow functions to be declared as non&ndash;side-effecting and referentially transparent, respectively; let's say I want to write `pure_assert` and `const_assert` macros, whose argument must be an expression of the appropriate level of strictness, that is:

    assert(oops_a_side_effect());

Silently results in different behaviours in debug and release, but:

    pure_assert(oops_a_side_effect());
    const_assert(oops_read_a_global());

Would be a compile-time error, at least in debug builds. For what I should hope are obvious reasons, you can't just create a `pure_assert_impl` declared `__attribute__((pure))` and have the macro expand to it. So is it possible to write these macros?