
On Wed, Dec 30, 2009 at 7:14 AM, Igor R <boost.lists@gmail.com> wrote:
Hello,
Could someone please explain the following behavior:
#include <boost/lambda/bind.hpp> #include <boost/bind.hpp>
struct Functor { void operator()() const {} template<class T> void func(T t) {} };
int main() { Functor f; boost::lambda::bind(&Functor::func<Functor>, &f, f); // doesn't compile boost::bind(&Functor::func<Functor>, &f, f); // compiles well }
Does it work with Boost.Phoenix? Boost.Phoenix includes the functionality of both and a great deal more. I have not tried this, but curious if it works for you: #include <boost/spirit/home/phoenix/bind/bind_function.hpp> #include <boost/lambda/bind.hpp> #include <boost/bind.hpp> struct Functor { void operator()() const {} template<class T> void func(T t) {} }; int main() { Functor f; boost::phoenix::bind(&Functor::func<Functor>, &f, f); // Does this compile? boost::lambda::bind(&Functor::func<Functor>, &f, f); // doesn't compile boost::bind(&Functor::func<Functor>, &f, f); // compiles well }