|
Boost : |
Subject: [boost] [phoenix] Bind member functions with non-const reference parameters
From: Sergiu Dotenco (sergiu.dotenco_at_[hidden])
Date: 2011-06-11 10:15:44
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).
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk