On 8/31/2015 12:50 PM, Hartmut Kaiser wrote:
I find it personally unfortunate that C++ decided to call it shared_ptr because of the word "shared" in the name, because it really isn't what its name says.
I believe that a lot of thought went into this decision. And it's called shared_ptr exactly because of that it represents shared ownership. I think you're again confused about what's the rationale of the design and what's the consequence of it. Shared ownership is the rationale, being an 'atomic safe reference counting implementation which provides no guarantees to its pointee' is a consequence.
Let me add that an "atomic safe reference counting implementation" is just one of the possible implementations. Although I am not aware of any concrete implementation doing things differently, there are alternative possible implementations like chaining, and it is the reason for having both `use_count` and `unique`. Regards, -- Agustín K-ballo Bergé.- http://talesofcpp.fusionfenix.com