Note: This paper was adopted into draft C++14 on Saturday at the Bristol UK ISO C++ meeting.
A new WG21 paper is available. A copy is linked below, and the paper will also appear in the next normal WG21 mailing. If you are not a committee member, please use the comments section below or the std-proposals forum for public discussion.
Document number: N3652
by Richard Smith
This is a major extension to
This paper describes the subset of N3597 selected for inclusion in C++14, relaxing a number of restrictions on constexpr functions. These changes all received overwhelmingly strong or unopposed support under review of the Evolution Working Group. It also incorporates Option 2 of N3598.
The changes selected by the Evolution Working Group were:
- Allow declarations within
constexprfunctions, other than:
switchstatements (but not
- Allow all looping statements:
- Allow mutation of objects whose lifetime began within the constant expression evaluation.
In addition, in discussion of N3598, Option 2 was selected, which removes the rule that a
constexprnon-static member function is implicitly