static_cast with boost :: shared_ptr?
Qual é o equivalente a umstatic_cast
comboost::shared_ptr
?
Em outras palavras, como preciso reescrever o seguinte
Base* b = new Derived();
Derived* d = static_cast<Derived*>(b);
quando usarshared_ptr
?
boost::shared_ptr<Base> b(new Derived());
boost::shared_ptr<Derived> d = ???