Is a closure object's operator() inline?
7.5.5 [expr.prim.lambda]
Daveed Vandevoorde

Created on 2009-02-06.00:00:00 last changed 143 months ago


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-06.00:00:00

A lambda expression appearing in local scope presumably creates a local class (in the sense of 11.6 [class.local]) as the type of the closure object, because that class is “considered to be defined at the point where the lambda expression occurs” (7.5.5 [expr.prim.lambda] paragraph 7), and in the absence of any indication to the contrary that class must satisfy the restrictions of 11.6 [class.local] on local classes. One such restriction is that all its member functions must be defined within the class definition, making them inline. However, nothing is said about whether the function call operator for a non-local closure class is inline, and even for the local case it would be better if the specification were explicit.

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: + msg2240
2009-08-03 00:00:00adminsetstatus: review -> dr
2009-03-23 00:00:00adminsetmessages: + msg1904
2009-03-23 00:00:00adminsetstatus: open -> review
2009-02-06 00:00:00admincreate