Title
Lambda expressions in default arguments of block-scope function declarations
Status
cd2
Section
7.5.6 [expr.prim.lambda]
Submitter
Daveed Vandevoorde

Created on 2008-12-10.00:00:00 last changed 179 months ago

Messages

Date: 2009-07-15.00:00:00

[Voted into the WP at the July, 2009 meeting as part of N2927.]

Date: 2009-07-15.00:00:00

Proposed resolution (July, 2009)

See document PL22.16/09-0117 = WG21 N2927.

Date: 2009-03-23.00:00:00

Is a lambda expression permitted in a default argument expression for a block-scope function declaration? For example,

    void g() {
      void f(std::reference_closure<void()> rc = []() {});
      f();
    }

This was not discussed in either the Evolution Working Group nor in the Core Working Group, and it is possible that some of the same implementation difficulties that led to prohibiting use of automatic variables in such default argument expressions (9.3.4.7 [dcl.fct.default] paragraph 7) might also apply to closure objects, even though they are not automatic variables.

(See also issue 772.)
History
Date User Action Args
2010-03-29 00:00:00adminsetstatus: wp -> cd2
2009-11-08 00:00:00adminsetstatus: dr -> wp
2009-08-03 00:00:00adminsetmessages: + msg2235
2009-08-03 00:00:00adminsetstatus: review -> dr
2009-03-23 00:00:00adminsetmessages: + msg1899
2009-03-23 00:00:00adminsetstatus: open -> review
2008-12-10 00:00:00admincreate