www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 18613] New: Documentation: recommended

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

          Issue ID: 18613
           Summary: Documentation: recommended construction/destruction
                    patterns for manual memory management
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dlang.org
          Assignee: nobody puremagic.com
          Reporter: turkeyman gmail.com

A colleague couldn't find an article he expected to exist.
I'm posting this on his behalf, because bugzilla doesn't use github login
credentials "yeah I literally clicked twice, was asked for login, closed :P"

```
Coming from C++ I was looking for delete after I did my new. I then found that
there was no delete because of GC.
To stay close to my C++ approach I decided not to use GC which then prompted
the issue, how do I call the dtor + free.
Current solution, make a function myDelete that calls dtor and free by hand.
Could use an article explaining the approach and highlighting pros and cons for
each method. It would also be useful to have a section on what is the preferred
way to do this manual memory management in D and why.
```

--
Mar 14 2018