cplusplus / nbballot

Handling of NB comments in response to ballots
14 stars 4 forks source link

US 12-041 7.5.5 [expr.prim.lambda] Static call operator for lambdas #486

Closed wg21bot closed 1 year ago

wg21bot commented 1 year ago

With the adoption of P1169 (static operator()), lambdas with no capture can have a static call operator. But only if someone explicitly writes that in code. That seems hostile to new code, which now has to write more annotation just in case it might matter for performance.

Proposed change:

Consider making the static-ness of the call operator implementation-defined, so that compilers can make this a switch.

erichkeane commented 1 year ago

Make the staticness of a capture-less lambda operator() implementation defined for C++23, as proposed in the NB comment.

SF F N A SA
0 0 3 15 6

Result: No Consensus for change: Recommend to Reject.