Title
Capturing references to functions
Status
cd2
Section
7.5.6.3 [expr.prim.lambda.capture]
Submitter
Steve Adamczyk

Created on 2009-02-12.00:00:00 last changed 178 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-02-12.00:00:00

According to 7.5.6 [expr.prim.lambda] paragraph 8, the “object type” of a captured function is the type to which the reference refers. That's clearly wrong when the captured reference is a reference to a function, because the resulting data member of the closure class will have a function type:

    void f() { }
    void g() {
      void (&fr)() = f;
      [fr]{};   // Oops...
    }
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: + msg2249
2009-08-03 00:00:00adminsetstatus: review -> dr
2009-03-23 00:00:00adminsetmessages: + msg1921
2009-02-12 00:00:00admincreate