Title
Parameter packs in lambda-captures
Status
cd2
Section
7.5.5.3 [expr.prim.lambda.capture]
Submitter
Faisal Vali

Created on 2009-05-23.00:00:00 last changed 170 months ago

Messages

Date: 2010-03-15.00:00:00

[Voted into WP at March, 2010 meeting.]

Date: 2009-10-15.00:00:00

Proposed resolution (October, 2009):

  1. Change the grammar in 7.5.5 [expr.prim.lambda] paragraph 1 as follows:

    • capture-list:
        capture ...opt
        capture-list , capture ...opt
  2. Add a new paragraph at the end of 7.5.5 [expr.prim.lambda]:

  3. A capture followed by an ellipsis is a pack expansion (13.7.4 [temp.variadic]). [Example:

        template<typename ...Args>
        void f(Args... args) {
          auto l = [&, args...] { return g(args...); };
          l();
        }
    
    

    end example]

  4. Add a new bullet to the list in 13.7.4 [temp.variadic] paragraph 4:

  5. [Editorial note: the editor may wish to consider sorting the bullets in this list in order of section reference.]

Date: 2009-05-23.00:00:00

The following is not allowed by the current syntax of lambda-capture but would be useful:

    template <typename ...Args> void f(Args... args) {
      auto l = [&, args...] { return g(args...); };
    }
History
Date User Action Args
2010-03-29 00:00:00adminsetmessages: + msg2671
2010-03-29 00:00:00adminsetstatus: ready -> cd2
2009-11-08 00:00:00adminsetmessages: + msg2341
2009-11-08 00:00:00adminsetstatus: open -> ready
2009-05-23 00:00:00admincreate