#include
struct Foo
{
const int& bar() const { return i; }
int i;
};
int main()
{
Foo f;
const int& ir = boost::phoenix::bind(&Foo::bar, f)();
}
The above fails to compile.
linux g++492 -std=c++11 -c 1.cpp
When bar() has a single int arg for e.g., boost::phoenix::bind(&Foo::bar,
f, 5)(); succeeds.
The error:
In file included from
/usr/include/boost/phoenix/bind/bind_member_variable.hpp:13:0,
from /usr/include/boost/phoenix/bind.hpp:17,
from /usr/include/boost/phoenix/phoenix.hpp:17,
from 1.cpp:1:
/usr/include/boost/phoenix/bind/detail/member_variable.hpp: In
instantiation of ‘struct boost::phoenix::detail::member_variable’:
/usr/include/boost/proto/make_expr.hpp:77:16: required from ‘struct
boost::proto::detail::protoify,
boost::proto::domainns_::basic_default_domain>’
/usr/include/boost/proto/detail/preprocessed/make_expr_.hpp:70:9:
required from ‘struct
boost::proto::detail::make_expr_, Foo, void, void, void, void, void, void, void, void,
void>’
/usr/include/boost/proto/make_expr.hpp:185:13: required from ‘struct
boost::proto::result_of::make_expr, Foo, void, void, void, void, void, void, void, void,
void>’
/usr/include/boost/phoenix/core/preprocessed/expression_10.hpp:84:13:
required from ‘struct boost::phoenix::expr_ext, Foo, void, void, void, void, void, void, void, void,
void>’
/usr/include/boost/phoenix/core/preprocessed/expression_10.hpp:24:12:
required from ‘struct
boost::phoenix::expr, Foo, void, void, void, void, void, void, void, void,
void>’
/usr/include/boost/phoenix/core/detail/preprocessed/function_eval_10.hpp:7:561:
required from ‘struct
boost::phoenix::detail::expression::function_eval, Foo, void, void, void, void,
void, void, void, void, void>’
/usr/include/boost/phoenix/bind/bind_member_variable.hpp:37:5: required
by substitution of ‘template const typename
boost::phoenix::detail::expression::function_eval, ClassT>::type boost::phoenix::bind(RT ClassT::*, ClassT&)
[with RT = const int&() const; ClassT = Foo]’
1.cpp:11:52: required from here
/usr/include/boost/phoenix/bind/detail/member_variable.hpp:50:17: error:
forming reference to qualified function type ‘const int&() const’
RT& operator()(Class& obj) const
^
/usr/include/boost/phoenix/bind/detail/member_variable.hpp:59:23: error:
forming reference to qualified function type ‘const int&() const’
RT const& operator()(Class const& obj) const
^
/usr/include/boost/phoenix/bind/detail/member_variable.hpp:68:17: error:
forming reference to qualified function type ‘const int&() const’
RT& operator()(Class* obj) const
^
/usr/include/boost/phoenix/bind/detail/member_variable.hpp:74:23: error:
forming reference to qualified function type ‘const int&() const’
RT const& operator()(Class const* obj) const
Rds,