|
Boost : |
Subject: Re: [boost] [phoenix] Bind member functions with non-const reference parameters
From: Thomas Heller (thom.heller_at_[hidden])
Date: 2011-06-12 06:54:43
On Saturday, June 11, 2011 04:15:44 PM Sergiu Dotenco wrote:
> 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).
Thanks for the report.
Fixed on trunk.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk