[phoenix] Bind member functions with non-const reference parameters

Using phoenix bind with member functions that have non-const reference parameters results in compile errors. However, free functions with similar signature seem to be supported. This behavior is inconsistent, especially compared to existing bind incarnations. For instance: #include <boost/bind.hpp> #include <boost/lambda/bind.hpp> #include <boost/phoenix/phoenix.hpp> void foo(int&) { } struct Foo { void bar(int&) { } }; int main() { using boost::phoenix::placeholders::arg1; int i = 0; Foo f; boost::phoenix::bind(foo, arg1)(i); // works boost::lambda::bind(&Foo::bar, &f, boost::lambda::_1)(i); // works boost::bind(&Foo::bar, &f, _1)(i); // works boost::phoenix::bind(&Foo::bar, &f, arg1)(i); // compile error } Tested with VC10 and boost trunk (r72541).
participants (2)
-
Sergiu Dotenco
-
Thomas Heller