A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://cplusplus.github.io/CWG/issues/1249.html below:

CWG Issue 1249

This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 117b. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2025-08-11

1249. Cv-qualification of nested lambda captureSection: 7.5.6.3  [expr.prim.lambda.capture]     Status: CD6     Submitter: James Widman     Date: 2011-03-02

[Accepted as a DR at the October, 2021 meeting.]

Consider the following example:

    void f(int i) {
      auto l1 = [i] {
        auto l2 = [&i] {
          ++i;    // Well-formed?
        };
      };
    }

Because the l1 lambda is not marked as mutable, its operator() is const; however, it is not clear from the wording of 7.5.6 [expr.prim.lambda] paragraph 16 whether the captured member of the enclosing lambda is considered const or not.

Proposed resolution (August, 2021):

Change 7.5.6.3 [expr.prim.lambda.capture] paragraph 14 as follows:

If a lambda-expression m2 captures an entity and that entity is captured by an immediately enclosing lambda-expression m1, then m2's capture is transformed as follows:


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4