Created on 2009-05-06.00:00:00 last changed 179 months ago
[Voted into WP at March, 2010 meeting.]
Proposed resolution (October, 2009):
Change 11.4.5.3 [class.copy.ctor] paragraph 17 second bullet as follows:
Notes from the July, 2009 meeting:
It is not clear how important this optimization is in the context of throw: how often is a large object with substantial copying overhead thrown? Also, throwing an exception is already a heavyweight operation, so presumably moving instead of copying an object would not make much difference.
11.4.5.3 [class.copy.ctor] paragraph 16 details the conditions under which a thrown object can be moved instead of copied. However, the optimization as currently described is unsafe. Consider the following example:
void f() { X x; try { throw x; } catch (...) { } // x may have been moved from but can still be accessed here }
When the operation is a throw, as opposed to a return, there must be a restriction that the object potentially being moved be defined within the innermost enclosing try block.
History | |||
---|---|---|---|
Date | User | Action | Args |
2010-03-29 00:00:00 | admin | set | messages: + msg2721 |
2010-03-29 00:00:00 | admin | set | status: ready -> cd2 |
2009-11-08 00:00:00 | admin | set | messages: + msg2368 |
2009-11-08 00:00:00 | admin | set | status: open -> ready |
2009-08-03 00:00:00 | admin | set | messages: + msg2221 |
2009-05-06 00:00:00 | admin | create |