wg21.cmeerw.net

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

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

The identifier in a simple-capture is looked up using the usual rules for unqualified name lookup (6.5.3 [basic.lookup.unqual]); each such lookup shall find a variable with automatic storage duration declared in the reaching scope of the local lambda expression.

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

Presumably such captures should be allowed, capturing the non-static data member directly rather than the this pointer from the enclosing lambda's operator() .

History Date User Action Args 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

Read the original on wg21.cmeerw.net ↗