Precise GC state

Ola Fosheim Grøstad ola.fosheim.grostad+dlang at gmail.com
Mon Nov 27 18:32:39 UTC 2017


On Monday, 27 November 2017 at 18:00:59 UTC, Jonathan M Davis 
wrote:
> I don't understand this. I would expect most modern C++ 
> programs to be using shared_ptr as the default for most 
> pointers and thus use it heavily.

You get this:

shared_ptr -> control_block -> object

Instead of this:

unique_ptr -> object
my_ref_ptr ->object


> shared_ptr is a _huge_ boon for avoiding memory problems.

Yes, if you don't mind the inefficiency, i.e. if you are doing 
high-level programming in C++.




More information about the Digitalmars-d mailing list