boost::shared_polymorphic_downcast and the other boost::shared_ptr functions reside in <boost/shared_ptr.hpp>
I recently enabled support for C++11 in GCC with -std=c++0x. In order to avoid confusion, I moved from boost::shared_ptr to std::shared_ptr which resides in #include <memory>.
However it appears that shared_polymorphic_downcast is not part of the std namespace and is not included with #include <memory>.
Do you know where it is? Did I miss the deprecation memo ;-)
You either need std::static_pointer_cast or std::dynamic_pointer_cast, depending on whether you want static_cast or dynamic_cast behavior.
Recent versions of Boost's Smart Pointers library include these functions for boost::shared_ptr too.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With