Title
Copy elision and lifetime of initializer_list underlying array
Status
nad
Section
9.4.5 [dcl.init.list]
Submitter
Steve Adamczyk

Created on 2012-10-10.00:00:00 last changed 95 months ago

Messages

Date: 2016-11-15.00:00:00

Rationale (November, 2016):

With the adoption of paper P0135R1, there is no longer any copy in this example to be elided.

Date: 2012-10-15.00:00:00

Notes from the October, 2012 meeting:

The consensus of CWG was that the behavior should be the same, regardless of whether the copy is elided or not.

Date: 2015-11-10.00:00:00

If an initializer_list object is copied and the copy is elided, is the lifetime of the underlying array object extended? E.g.,

  void f() {
    std::initializer_list<int> L =
        std::initializer_list<int>{1, 2, 3}; // Lifetime of array extended?
  }

The current wording is not clear.

(See also issue 1299.)

History
Date User Action Args
2017-02-06 00:00:00adminsetmessages: + msg5988
2017-02-06 00:00:00adminsetstatus: drafting -> nad
2012-11-03 00:00:00adminsetmessages: + msg4097
2012-10-10 00:00:00admincreate