Bug 19214 – Support object.destruct() for efficient (and correct!) destruction
Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P1
Component
druntime
Product
D
Version
D2
Platform
All
OS
All
Creation time
2018-09-03T21:17:48Z
Last change time
2018-11-30T12:32:38Z
Assigned to
No Owner
Creator
Manu
Comments
Comment #0 by turkeyman — 2018-09-03T21:17:48Z
Please consider adding an object.destruct() function beside object.destroy() to perform efficient destruction.
Not all instances of destruction should pay the code of re-initialisation.
Language complexity surrounding destruction makes direct calls to __dtor/__xdtor too complex for the user to understand and implement correctly, as evidenced by a myriad of OSS libs that have attempted, and failed.