Boost logo

Boost Users :

From: Alexander Shyrokov (shirokov_at_[hidden])
Date: 2006-09-15 14:46:02


I have a map<int,c*> and I would like to call a member function of the
c* and provide a parameter to it.

struct c{void f(char*){}};
typedef std::map<int,c*> TMap;
TMap a;
std::for_each(a.begin(),a.end(),boost::bind(&c::f,boost::bind(&TMap::value_type::second,_1)),NULL);

I get "error C2091: function returns function"

This is what I would like to replace with the for_each algorithm:
for(TMap::iterator i=a.begin();i!=a.end();++i)(*i)->f(NULL);

Thanks.

-- 
Regards,
     Alexander.                http://sjcomp.com

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