2
class B
もし導出することができます私はdynamic_cast
shared_ptr<B>
shared_ptr<A>
に基底クラスにsmartpointers、およびshared_ptr<A>
からshared_ptr<B>
か?鋳造<code>class A</code>から
dynamic cast
を使用すると、Javaでinstanceof
のようなことができます。これがsmart_ptr
でも動作するかどうか、私は自分自身に尋ねました。
関連:http://stackoverflow.com/questions/19932629/implicit-conversion- of-shared-ptr –