G
Gonsolo
Hi!
I try to do the following:
class A {
};
class B : public A {
};
int main()
{
vector< shared_ptr<A> > v;
shared_ptr<B> d( new B );
v.push_back( d );
shared_ptr<B> d2 = dynamic_pointer_cast( v[0] );
}
and the compiler (g++) bails out with an:
error: no matching function for call to
'dynamic_pointer_cast(boost::shared_ptr<A>&)'
Is dynamic_pointer_cast supposed to work with containers like vector?
Thanks.
I try to do the following:
class A {
};
class B : public A {
};
int main()
{
vector< shared_ptr<A> > v;
shared_ptr<B> d( new B );
v.push_back( d );
shared_ptr<B> d2 = dynamic_pointer_cast( v[0] );
}
and the compiler (g++) bails out with an:
error: no matching function for call to
'dynamic_pointer_cast(boost::shared_ptr<A>&)'
Is dynamic_pointer_cast supposed to work with containers like vector?
Thanks.