constexpr
contextsconstexpr
contextsstatic_assert
in a constexpr
function for an expression that's dependent on function parameters ("constexpr
" means "maybe this might be evaluated in a constant expression"). But you can just use assert
as usual
constexpr
mean?constexpr
mean?constexpr
you mean!constexpr
variables
constexpr
functions
constexpr
if statements (a.k.a., if constexpr
)
constexpr
uses require different things to be constant expressionsconstexpr
variables require constant initializers
constexpr
if statements require constant conditional expressions
constexpr
functions require ???
constexpr
mean (for a function)?Look at how we can use it...
constexpr
variable...
static_assert
...
constexpr
functions can be used with runtime parameters!
constexpr
mean? (And why?)constexpr
means maybe this might be evaluated in a constant expression"constexpr
function that never can be used in a constant expression is ill-formed: