Title
Lifetime of temporaries in init-captures
Status
dup
Section
7.5.6.3 [expr.prim.lambda.capture]
Submitter
Daveed Vandevoorde

Created on 2014-05-14.00:00:00 last changed 127 months ago

Messages

Date: 2014-07-07.00:00:00

The current Standard is not clear regarding the lifetime of a temporary created in the initializer of an init-capture:

  void g() {
    struct S { S(int); ~S(); };
    auto x = (S(1), [y = S(2)]{}, S(3));
  }

Is the initializer for y considered a full-expression, or does the S(2) temporary persist until the end of the complete x initializer?

Reationale (June, 2014):

This issue is a duplicate of issue 1695.

History
Date User Action Args
2014-07-07 00:00:00adminsetstatus: open -> dup
2014-05-14 00:00:00admincreate