Title
Generalized lambda-captures
Status
cd3
Section
7.5.6.3 [expr.prim.lambda.capture]
Submitter
John Freeman

Created on 2008-12-11.00:00:00 last changed 130 months ago

Messages

Date: 2014-03-03.00:00:00

Rationale, March, 2009:

This idea was discussed and rejected by the EWG.

This issue was addressed by the adoption of N3648, adopted at the April, 2013 (Bristol) meeting.

Date: 2022-11-20.07:54:16

In the current specification of lambda expressions, a name appearing in a lambda-capture must refer to a local variable or reference with automatic storage duration (7.5.6 [expr.prim.lambda] paragraph 3). This restriction seems unnecessary and possibly confusing.

One possibility would be to extend the syntax of the lambda-capture to be something like

v = expr

with the meaning that the closure object would have a member named v initialized with the value expr. With this extension, the current syntax could be viewed as an abbreviation for

v = v
History
Date User Action Args
2014-03-03 00:00:00adminsetstatus: extension -> cd3
2009-03-23 00:00:00adminsetmessages: + msg2035
2009-03-23 00:00:00adminsetstatus: open -> extension
2008-12-11 00:00:00admincreate