What is the difference between D and C++ regarding Unique, RefCounted and Scoped?

ponce via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Sep 9 12:53:52 PDT 2015


On Wednesday, 9 September 2015 at 19:48:00 UTC, cym13 wrote:
> Hi,
>
> I know C++ and D without being a C++ or D guru (I know way more 
> about D though). When talking about memory management the 
> problem of RAII is often mentioned along with the fact that 
> classes use the GC. I know well the difference between structs 
> and classes and don't want to talk about the GC here.
>
> It seems to me that just as one can manage his memory in C++ 
> using unique_ptr, shared_ptr and basic RAII we can manage our 
> memory using Unique, RefCounted and Scoped.
>
> My question is: what is possible in C++ that isn't in D?

C++ only h



How
> come that we are getting memory debates at all on this matter 
> if we can do the same thing? If there are differences is fixing 
> them an option to have something to show to D detractors?




More information about the Digitalmars-d-learn mailing list