
20 Sep
2011
20 Sep
'11
2:43 p.m.
shared_ptr also has an aliasing copy constructor, where you can give it an arbitrary pointer. So, you might make a shared_ptr that points at a struct and a shared_ptr that points at a member of the same struct, but they both share the same reference count and deleter.
Could you elaborate a bit? struct inner { //... }; struct outer { inner inner_; }; Do you mean that one can make shared_ptr<inner> from shared_ptr<outer>?