On Mar 26, 10:17 pm, STL-BOOST <wartal...@gmail.com> wrote:
Hi all:
how do i use bind for this:
struct fun
{
void exe()(int i){}
}
vector<fun> vec;
for_each(vec.begin(), vec.end(), ?);
Do you really want fun::exe to return a pointer to a function?
I am assuming it is just a method that takes an int:
#include <vector>
#include <algorithm>
#include <functional>
struct XXfun
{
void exe(int i){}
};
struct YYfun
{
operator()(int x){}
};
int main()
{
std::vector<XXfun> vec;
std::for_each(vec.begin(), vec.end(),
std::bind2nd(std::mem_fun_ref(&XXfun::exe),1));
std::vector<YYfun> data;
YYfun yyFun;
std::for_each(vec.begin(), vec.end(), yyFun);
}- =D2=FE=B2=D8=B1=BB=D2=FD=D3=C3=CE=C4=D7=D6 -
- =CF=D4=CA=BE=D2=FD=D3=C3=B5=C4=CE=C4=D7=D6 -