Boost logo

Boost Users :

From: Delfin Rojas (drojas_at_[hidden])
Date: 2005-02-16 22:09:10


Hi all,

I would like to know if there is a way right now or if there is a plan to
add the possibility of using bll::bind (boost lambda bind) with shared_ptr
as one uses it with normal pointers.

This functionality is currently supported by boost::bind but I cannot find a
way to make it work with lambda bind.

For example:

class CFoo
{
public:
        void SetI(const int & nI) { ... }
};

std::vector<CFoo*> vpFoos;
std::vector< boost::shared_ptr<CFoo> > vpFoos2;

//Assume I initialize the vectors

std::for_each(vpFoos.begin(),vpFoos.end(), boost::lambda::bind(&CFoo::SetI,
boost::lambda::_1, 5)); //Works great

//I _cannot_ find to make this work with vpFoos2; I _can_ make it work with
boost::bind.

Thanks

-delfin


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net