muu/is_constant_evaluated.h file

Contains the definitions of muu::is_constant_evaluated(), MUU_IF_CONSTEVAL and MUU_IF_RUNTIME.

Namespaces

namespace muu
The root namespace for all muu functions and types.
namespace muu::build
Build environment information (compiler, date/time, support for various things...)

Functions

auto is_constant_evaluated() -> bool constexpr noexcept
Equivalent to C++20's std::is_constant_evaluated.

Variables

bool supports_is_constant_evaluated constexpr
True if is_constant_evaluated() is properly supported on this compiler.

Defines

#define MUU_IF_CONSTEVAL
Begins an if consteval block if supported, otherwise falls back on muu::is_constant_evaluated().
#define MUU_IF_RUNTIME
Begins an if !consteval block if supported, otherwise falls back on muu::is_constant_evaluated().