Title
constexpr defaulted constructors
Status
c++11
Section
9.3.2 [dcl.name]
Submitter
Jens Maurer

Created on 2011-02-02.00:00:00 last changed 130 months ago

Messages

Date: 2011-03-15.00:00:00

[Voted into the WP at the March, 2011 meeting.]

Date: 2011-02-15.00:00:00

Proposed resolution (February, 2011):

  1. Change 9.2.6 [dcl.constexpr] paragraph 3 as follows:

    • ...

    • its function-body shall be = delete, = default, or a compound-statement of the form

        { return expression ; }
      
    • ...

  2. Change 9.2.6 [dcl.constexpr] paragraph 4 as follows:

  3. In the definition of a constexpr constructor, each of the parameter types shall be a literal type or a reference to a literal type. In addition, either its function-body shall be = delete or = default or it shall satisfy the following constraints:

    • ...

    A trivial copy/move constructor is also a constexpr constructor.

[Note: this resolution assumes that the changes for issue 1199 have been applied.]
Date: 2011-02-02.00:00:00

Issue 1199 proposes to add the capability of defining a constexpr special function as deleted. It would be similarly useful to be able to mark a defaulted constructor as constexpr. (It should be noted that the existing text of 11.4.5 [class.ctor] and the proposed resolution of issue 1224 already allow for implicitly-defined constructors to be implicitly constexpr; this issue simply proposes allowing the explicit use of the constexpr specifier.)

History
Date User Action Args
2014-03-03 00:00:00adminsetstatus: fdis -> c++11
2011-04-10 00:00:00adminsetmessages: + msg3340
2011-04-10 00:00:00adminsetstatus: tentatively ready -> fdis
2011-02-28 00:00:00adminsetmessages: + msg3230
2011-02-02 00:00:00admincreate