
I've looked through the shared_ptr documentation and am still puzzled about something. suppose I have class base1 { virtual ~base1; ... }; class derived1 : public base1 { .... }; shared_ptr<derived1> pd1(new derived1) shared_ptr<base1> pb1(pd); ? do pd1 and pb1 refer to the same object? class base2 { virtual ~base2; ... }; class derived3 : public base1, public base2 { ... }; shared_ptr<base2> pb2(pd1); ? do pb1 and pb2 refer to the same object? I'm presuming they do, but it's not really clear to me that this would work. To check this I could downcast everything to derived3. BUT when I have pb1 and pb2, I don't know what to downcast to. since there could be class derived4 : public base1, public base2 { ... }; So how could I verify whether an arbitrary pb1 and pb2 point to the same object or not? Robert Ramey