|
Boost Users : |
Subject: [Boost-users] phoenix 1.55 no-arg mem function fails
From: MM (finjulhich_at_[hidden])
Date: 2015-03-20 16:48:09
#include <boost/phoenix/phoenix.hpp>
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<const
int&() const, const int& (Foo::*)() const>â:
/usr/include/boost/proto/make_expr.hpp:77:16: required from âstruct
boost::proto::detail::protoify<boost::phoenix::detail::member_variable<const
int&() const, const int& (Foo::*)() const>,
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_<boost::phoenix::detail::tag::function_eval,
boost::proto::domainns_::basic_default_domain,
boost::phoenix::detail::member_variable<const int&() const, const int&
(Foo::*)() const>, 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<boost::phoenix::detail::tag::function_eval,
boost::proto::domainns_::basic_default_domain,
boost::phoenix::detail::member_variable<const int&() const, const int&
(Foo::*)() const>, 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<boost::phoenix::actor,
boost::phoenix::detail::tag::function_eval,
boost::phoenix::detail::member_variable<const int&() const, const int&
(Foo::*)() const>, 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<boost::phoenix::detail::tag::function_eval,
boost::phoenix::detail::member_variable<const int&() const, const int&
(Foo::*)() const>, 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<boost::phoenix::detail::member_variable<const
int&() const, const int& (Foo::*)() const>, 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<class RT, class ClassT> const typename
boost::phoenix::detail::expression::function_eval<boost::phoenix::detail::member_variable<RT,
RT ClassT::*>, 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,
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net