constexpr relaxations (C++23)
Non-literal variables, labels, gotos and static constexpr variables in constexpr functions; unknown references in constant expressions.
Connected features
Papers
4 · Virtual Oct 2021 → Kona 2022Permits non-literal variables, labels and goto in constexpr functions as long as they are never evaluated at compile time.
Allows references and pointers of unknown value in constant expressions, e.g. std::size(arr) on a reference parameter (DR).
Drops the rule that a constexpr function must have at least one constant-evaluable call; it may now never produce a constant.
Permits static constexpr variables inside constexpr functions.