14 Aug
2007
14 Aug
'07
6:34 p.m.
Is there a way to use any_cast for polymorphic types? For instance,
let's say I've got a Base class and a Derived class. I want to be able
to any_cast a Derived * to a Base * successfully, like so:
class Base { virtual ~Base() {} };
class Derived : public Base { virtual ~Derived() {} };
Derived d;
boost::any a = &d;
boost::any_cast