C++23: Even more constexpr
Ever since C++ introduced the constexpr keyword in C++11, each new standard brought us more and more opportunities to make our code increasingly constexpr, in other words, compile-time execution friendly. In this article, we are going to review briefly what changes with C++23 on this front. Non-literal variables in constexpr functions P2242R3 proposes to remove the restriction that a constexpr function cannot contain a definition of a variable of a non-literal type a definition of a variable of static or thread storage duration, or a goto statement, or an identifier label. The rationale behind this change is that the presence…
Sandor Dargo’s Blog