www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 19214] New: Support object.destruct() for efficient (and

https://issues.dlang.org/show_bug.cgi?id=19214

          Issue ID: 19214
           Summary: Support object.destruct() for efficient (and correct!)
                    destruction
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: druntime
          Assignee: nobody puremagic.com
          Reporter: turkeyman gmail.com

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.

--
Sep 03 2018