Boost logo

Boost Users :

From: Douglas Gregor (gregod_at_[hidden])
Date: 2003-07-15 23:52:49


> //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


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