Title
Lifetime extension via init-capture
Status
nad
Section
6.7.7 [class.temporary]
Submitter
Richard Smith

Created on 2013-05-31.00:00:00 last changed 127 months ago

Messages

Date: 2014-06-15.00:00:00

Rationale (June, 2014):

After further consideration, CWG agreed that this example should extend the lifetime of the temporary (because the notional variable is a reference) and that the existing text is clear enough in this regard.

Date: 2013-09-15.00:00:00

Notes from the September, 2013 meeting:

CWG agreed that there is no lifetime extension in this example.

Date: 2013-05-31.00:00:00

If an init-capture binds a const reference to a temporary, is the lifetime of the temporary extended to match that of the lambda? For example,

   struct S { ~S(); };
   const S f();
   auto &&lambda = [&x(f())] () -> auto& { return x; };
   auto &y = lambda(); // ok?
History
Date User Action Args
2014-07-07 00:00:00adminsetmessages: + msg5115
2014-07-07 00:00:00adminsetstatus: drafting -> nad
2013-10-14 00:00:00adminsetmessages: + msg4630
2013-10-14 00:00:00adminsetstatus: open -> drafting
2013-05-31 00:00:00admincreate