Created on 2010-08-02.00:00:00 last changed 174 months ago
Rationale (August, 2010):
The behavior is according to the original design and is similar to what would happen if the constructor of the closure object initialized the members for the captured entities using mem-initializers. CWG did not see sufficient motivation to change the design.
According to 7.5.6 [expr.prim.lambda] paragraph 21,
When the lambda-expression is evaluated, the entities that are captured by copy are used to direct-initialize each corresponding non-static data member of the resulting closure object.
This apparently means that if the capture-default is to copy, entities captured by default, implicitly, are copied even in cases where the copy constructors of such entities are explicit. It should be required that such entities be captured explicitly instead.
See also issue 1020.
History | |||
---|---|---|---|
Date | User | Action | Args |
2010-08-23 00:00:00 | admin | set | messages: + msg2942 |
2010-08-02 00:00:00 | admin | create |