
16 Jul
2003
16 Jul
'03
4:52 a.m.
//This works //std::cout << boost::bind2nd<FType>(boost::mem_fun(&Foo::operator ()), 7)(&foo) << "\n";
I strongly suggest that you use: boost::bind(&Foo::operator(), _1, 7)(&foo);
//This does not. std::cout << boost::bind2nd(boost::mem_fun(&Foo::operator ()), 7)(&foo) << "\n";
I am just not seeing where the ambiguity is coming from. The commented out line will actually compile and run as I expected, but I can't figure out why the compiler can't deduce the template argument. Any ideas?
Thanks in Advance!
You want to use Boost.Bind. Really. Most of boost/functional.hpp should probably be deprecated (along with boost/compose.hpp), because Bind is superior in almost every aspect. Doug