
15 Sep
2006
15 Sep
'06
6:46 p.m.
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