
4 Feb
2004
4 Feb
'04
9:06 a.m.
So I have something like this:
std::vector<boost::shared_ptr<Base> > BaseVector;
void add(boost::shared_ptr<Base>& newOne) { BaseVector.push_back(newOne); }
and I call it like this usually : boost::shared_ptr<Derived> p(new Derived); add(p);
I think the problem is you take a reference to the shared_ptr. Try this way: void add(boost::shared_ptr<Base> newOne) { BaseVector.push_back(newOne); } -- Michele Galante Zucchetti Centro Sistemi SPA m.galante@centrosistemi.it