
26 Jul
2003
26 Jul
'03
11:23 p.m.
On Sat, 2003-07-26 at 20:57, Joshua wrote: Hi
typedef std::vector<boost::shared_ptr<Foo> > FooVector;
FooVector Foobar; Foo* blah = new Foo(); boost::shared_ptr<Foo> * NewPointer = new boost::shared_ptr<Foo>(blah); Foobar.insert(*NewPointer); //Yes I know this looks horrible. And its probably wrong.
The above isn't quite right. You're inserting pointers to shared_ptr's. Try this instead: typedef std::vector<boost::shared_ptr<Foo> > FooVector; FooVector Foobar; Foobar.push_back( new Foo(blah) ); -- Regards Paul Paul Grenyer Email: pjgrenyer@iee.org Web: www.paulgrenyer.co.uk EvaneScence: http://www.evanescence.com