On Jul 14, 2013, at 12:56 AM, SomeDude <lovelyd...@mailmetrash.com> wrote:
> 
> C++ has gone te ARC route as well with shared_ptr. I find the 
> scoped_ptr/shared_ptr combination quite convenient and quite safe overall.

The thing that finally pushed me towards D was one day when I was looking at my 
C++ code and I realized just how much effort I'd put into defining data 
ownership rules.  And while tools like shared_ptr may automate the reference 
counting portion of the task in that case, the pointer type still needs to be 
defined somewhere and honored by all users of that API.  And shared_ptr isn't 
even terribly efficient by default because it has to assume sharing across 
threads, so you're stuck with memory synchronization techniques being employed 
every time a shared_ptr is copied.  Don't get me wrong, I think shared_ptr is a 
wonderful thing, but to be really competitive it would have to be truly 
automatic and have its behavior informed by a type label like "shared".


Sean

Reply via email to