Boost logo

Boost Users :

Subject: Re: [Boost-users] pointer to member function of multi_index
From: Sandeep Gupta (gupta.sandeep_at_[hidden])
Date: 2009-03-18 20:26:38


On Wed, Mar 18, 2009 at 3:18 PM, Steven Watanabe <watanabesj_at_[hidden]> wrote:
> AMDG
>
> Sandeep Gupta wrote:
>>
>> On first glance I missed how to go about using them. I am afraid this
>> approach fails as well.
>> The commands:
>>       vector<int> myvec;
>>       bind(push_back, myvec, arg1)(5);
>>
>> error: no class template named ‘result’ in ‘struct
>> boost::phoenix::function<boost::phoenix::stl::push_back>’
>>
>> Again thanks so much more so for being patient.
>>
>
> phoenix::function doesn't need bind:
>
> phoenix::push_back(phoenix::ref(myvec), arg1)(5);
>

Thanks Steven,. Unfortunately, this also fails. Below is the error.

error:
PhoneixTricks.cpp: In function ‘int main()’:

PhoneixTricks.cpp:30: error: no match for call to
‘(boost::phoenix::actor<boost::phoenix::composite<boost::phoenix::detail::function_eval<2>,
boost::fusion::vector<boost::phoenix::value<boost::phoenix::stl::push_back>,
boost::phoenix::value<boost::reference_wrapper<std::vector<int,
std::allocator<int> > > >, boost::phoenix::argument<0>,
boost::fusion::void_, boost::fusion::void_, boost::fusion::void_,
boost::fusion::void_, boost::fusion::void_, boost::fusion::void_,
boost::fusion::void_> > >) (int)’
/home/sandeep/Computing/boost_1_38_0/boost/spirit/home/phoenix/core/actor.hpp:91:
note: candidates are: typename boost::mpl::eval_if<typename
Eval::no_nullary,
boost::mpl::identity<boost::phoenix::detail::error_expecting_arguments>,
boost::phoenix::eval_result<Eval,
boost::phoenix::basic_environment<boost::fusion::void_,
boost::fusion::void_, boost::fusion::void_, boost::fusion::void_,
boost::fusion::void_, boost::fusion::void_, boost::fusion::void_,
boost::fusion::void_, boost::fusion::void_, boost::fusion::void_> >
>::type boost::phoenix::actor<Eval>::operator()() const [with Eval =
boost::phoenix::composite<boost::phoenix::detail::function_eval<2>,
boost::fusion::vector<boost::phoenix::value<boost::phoenix::stl::push_back>,
boost::phoenix::value<boost::reference_wrapper<std::vector<int,
std::allocator<int> > > >, boost::phoenix::argument<0>,
boost::fusion::void_, boost::fusion::void_, boost::fusion::void_,
boost::fusion::void_, boost::fusion::void_, boost::fusion::void_,
boost::fusion::void_> >]
/home/sandeep/Computing/boost_1_38_0/boost/spirit/home/phoenix/core/actor.hpp:108:
note: typename
boost::phoenix::actor<Eval>::result<boost::phoenix::actor<Eval>
()(T0&)>::type boost::phoenix::actor<Eval>::operator()(T0&) const
[with T0 = int, Eval =
boost::phoenix::composite<boost::phoenix::detail::function_eval<2>,
boost::fusion::vector<boost::phoenix::value<boost::phoenix::stl::push_back>,
boost::phoenix::value<boost::reference_wrapper<std::vector<int,
std::allocator<int> > > >, boost::phoenix::argument<0>,
boost::fusion::void_, boost::fusion::void_, boost::fusion::void_,
boost::fusion::void_, boost::fusion::void_, boost::fusion::void_,
boost::fusion::void_> >]


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