Movatterモバイル変換


[0]ホーム

URL:


Issue 1681 - WG21 CWG Issues
Title
init-captures and nested lambdas
Status
c++14
Section
7.5.6.3 [expr.prim.lambda.capture]
Submitter
Richard Smith

Created on2013-05-14.00:00:00 last changed136 months ago

Messages

msg4577 (view)
Date: 2013-09-15.00:00:00

Proposed resolution (September, 2013):

This issue is resolved by the resolution ofissue 1760.

msg4491 (view)
Date: 2014-02-15.00:00:00

[Applied to WP at the February, 2014 meeting.]

According to 7.5.6 [expr.prim.lambda] paragraph 10,

Theidentifier in asimple-capture is looked up using theusual rules for unqualified name lookup (6.5.3 [basic.lookup.unqual]); eachsuch lookup shall find a variable with automatic storage duration declaredin the reaching scope of the local lambda expression.

This does not permit a nested lambda to capture the non-staticdata member of the closure type introduced by aninit-capture.A similar restriction applies to implicit capture in paragraph 12.

Presumably such captures should be allowed, capturing the non-staticdata member directly rather than thethis pointer from theenclosing lambda'soperator().

History
DateUserActionArgs
2014-11-24 00:00:00adminsetstatus: accepted -> c++14
2014-03-03 00:00:00adminsetstatus: ready -> accepted
2013-10-14 00:00:00adminsetmessages: +msg4577
2013-10-14 00:00:00adminsetstatus: open -> ready
2013-05-14 00:00:00admincreate

[8]ページ先頭

©2009-2026 Movatter.jp