
Igor R wrote, about the aliasing constructor:
Wow! I never payed attention to that ctor. Great feature. I think it's worth to be highlighted somewhere in the docs.
This is a relatively late addition (shared_ptr it was already in std:: and part of the draft standard when the aliasing constructor was added). It's worth noting that it was always possible to do this: http://www.boost.org/doc/libs/1_47_0/libs/smart_ptr/sp_techniques.html#anoth... (you just need to realize that the "another smart pointer" can be shared_ptr) but the aliasing constructor made it more efficient and more explicit (with respect to the shared ownership). Getting back to the original question, it's possible to have two shared_ptr<T> instances that share ownership and have different get() pointers, without any aliasing tricks: struct X {}; struct Y: X {}; struct Z: X {}; struct W: Y, Z {}; shared_ptr<W> pw( new W ); shared_ptr<Y> py( pw ); shared_ptr<Z> pz( pw ); shared_ptr<X> px( py ); shared_ptr<X> px2( pz );