quick bind1st question
-
I am trying to use this:
for_each(stringname.begin(),stringname.end(),bind1st(MyFunctionName, Arg2);
this is not passing Arg2 to MyFunctionName(Arg1, Arg2).. I am getting the following errors: error C2825: '_Fn2::second_argument_type': cannot form a qualified name error C2039: 'second_argument_type' : is not a member of 'operator``global namespace''' I can implement this easily as a functor if I make a class for it, but I thought you could use a function and just use it's name without any arguments using bind1st... am I wrong? Thx.
-
I am trying to use this:
for_each(stringname.begin(),stringname.end(),bind1st(MyFunctionName, Arg2);
this is not passing Arg2 to MyFunctionName(Arg1, Arg2).. I am getting the following errors: error C2825: '_Fn2::second_argument_type': cannot form a qualified name error C2039: 'second_argument_type' : is not a member of 'operator``global namespace''' I can implement this easily as a functor if I make a class for it, but I thought you could use a function and just use it's name without any arguments using bind1st... am I wrong? Thx.
I think you need to use
ptr_fun()
to get a functor. Stability. What an interesting concept. -- Chris Maunder