Subject: Re: [Boost-users] Problem with shared_ptr
From: Igor R (boost.lists_at_[hidden])
Date: 2009-01-14 07:53:56


> boost::shared_ptr<DerivedClass> ptr =
> boost::dynamic_pointer_cast<DerivedClass>(en);
>
> //Error when push_back. Instead of ptr, I get 0
> result.push_back(ptr);

Are you sure ptr is non-zero? Probably, dynamic_pointer_cast failed
and returned 0.