Created on 2009-05-20.00:00:00 last changed 19 months ago
Additional notes (April, 2023):
An additional use-case for a deleted deallocation function would be to ensure that the initialization of the object is not potentially-throwing.
For cases where the deallocation function is never called from the constructor, access checking for it should not be done.
Notes from the July, 2009 meeting:
The rationale for defining a deallocation function as deleted would presumably be to prevent such objects from being freed. Treating the new-expression as a use of such a deallocation function would mean that such objects could not be created in the first place. There is already an exemption from freeing an object if “a suitable deallocation function [cannot] be found;” a deleted deallocation function should be treated similarly.
It is not clear from 7.6.2.8 [expr.new] whether a deleted operator delete is referenced by a new-expression in which there is no initialization or in which the initialization cannot throw an exception, rendering the program ill-formed. (The question also arises as to whether such a new-expression constitutes a “use” of the deallocation function in the sense of 6.3 [basic.def.odr].)
History | |||
---|---|---|---|
Date | User | Action | Args |
2023-04-28 21:41:42 | admin | set | messages: + msg7262 |
2009-08-03 00:00:00 | admin | set | messages: + msg2191 |
2009-08-03 00:00:00 | admin | set | status: open -> drafting |
2009-05-20 00:00:00 | admin | create |