
3 Mar
2005
3 Mar
'05
8:18 a.m.
Hi, would it be possible to implement something the following lines using lambda, without having all values referring to the same shared object: ... #include <boost/shared_ptr.hpp> #include <boost/lambda/lambda.hpp> #include <algorithm> #include "Foo.h" ... using namespace boost; using namespace boost::lambda; std::vector<shared_ptr<Foo> > foos(10); std::for_each(foos.begin(), foos.end(), _1 = shared_ptr<Foo>(new Foo)); Thanks // Johan