Created on 2014-06-04.00:00:00 last changed 28 months ago
Additional notes (July, 2022):
Issue 1880 permitted the destruction of parameter objects at the end of the full-expression enclosing the function call. Issue 2177 clarified the exceptions to the parameter object reuse.
Notes from the November, 2014 meeting:
The resolution for issue 1880 should mostly resolve this issue. The resolution should handle the case in which an object can only be constructed into the parameter object and neither copied nor moved.
[Resolved by CWG1880 (November, 2014) and CWG2177 (November, 2017).]
The description in 7.6.2.8 [expr.new] paragraph 23 regarding calling a deallocation function following an exception during the initialization of an object resulting from a placement new-expression says,
If a placement deallocation function is called, it is passed the same additional arguments as were passed to the placement allocation function, that is, the same arguments as those specified with the new-placement syntax. If the implementation is allowed to make a copy of any argument as part of the call to the allocation function, it is allowed to make a copy (of the same original value) as part of the call to the deallocation function or to reuse the copy made as part of the call to the allocation function. If the copy is elided in one place, it need not be elided in the other.
This seems curious, as it allows reuse of a parameter object that presumably is destroyed immediately upon the return of the allocation function (but see issue 1880 for a question about the timing of such destructions).
History | |||
---|---|---|---|
Date | User | Action | Args |
2022-08-19 07:54:33 | admin | set | messages: + msg6889 |
2022-08-19 07:54:33 | admin | set | status: review -> cd5 |
2022-07-15 12:53:45 | admin | set | messages: + msg6883 |
2022-07-15 12:53:45 | admin | set | status: drafting -> review |
2014-11-24 00:00:00 | admin | set | messages: + msg5193 |
2014-11-24 00:00:00 | admin | set | status: open -> drafting |
2014-06-04 00:00:00 | admin | create |