[Issue 9137] New: A function that equals to "out of scope" action for manual lifetime management

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Dec 10 11:17:50 PST 2012


http://d.puremagic.com/issues/show_bug.cgi?id=9137

           Summary: A function that equals to "out of scope" action for
                    manual lifetime management
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Phobos
        AssignedTo: nobody at puremagic.com
        ReportedBy: verylonglogin.reg at gmail.com


--- Comment #0 from Denis Shelomovskij <verylonglogin.reg at gmail.com> 2012-12-10 22:17:49 MSK ---
We already have `emplace` to create an object but there is not function to
destroy the object. Yes, we have `destroy` but it is "to reclaim non-memory
resources without compromising memory safety" (as Andrei said).

So I'd like to have a `destuct` function destroying its argument just like as
if it goes out of scope and, optionally, resetting object memory to it's
initial state.

The function is implemented here:
https://github.com/D-Programming-Language/phobos/pull/929

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list