Implicit conversion of shared_ptr
问题 I have two shared_ptrs of the classes U and T where T is the base of U. It is no problem to do an implicit conversion from shared_ptr<U> to shared_ptr<T> . But is is also possible to do a conversion from shared_ptr<T> to shared_ptr<U> ? I tried the sugested solution: class T { public: virtual ~T() {} protected: void fillData() = 0; }; class Timpl : public T { public: virtual ~Timpl() {} protected: virtual void fillData() = 0; }; class U : public Timpl { public: virtual ~U() {} protected: