|
Boost Users : |
Subject: Re: [Boost-users] [phoenix] accumulate with data member binding
From: Christian Henning (chhenning_at_[hidden])
Date: 2008-11-01 17:48:26
Sergey, I tried your code but it fails on me when using Visual Studio
9. It creates 18 errors. Here is a snippet:
1>c:\boost\boost\spirit\home\phoenix\core\detail\function_eval.hpp(40)
: error C2825: 'boost::phoenix::detail::function_eval<0>::result<Env,F>::fn':
must be a class or namespace when followed by '::'
1> with
1> [
1> Env=boost::phoenix::basic_environment<>,
1> F=boost::phoenix::value<double point::* >
1> ]
1> c:\boost\boost\spirit\home\phoenix\core\detail\composite_eval.hpp(88)
: see reference to class template instantiation
'boost::phoenix::detail::function_eval<0>::result<Env,F>' being
compiled
1> with
1> [
1> Env=boost::phoenix::basic_environment<>,
1> F=boost::phoenix::value<double point::* >
1> ]
1> c:\boost\boost\spirit\home\phoenix\core\composite.hpp(64) :
see reference to class template instantiation
'boost::phoenix::detail::composite_eval<1>::result<Composite,Env>'
being compiled
1> with
1> [
1> Composite=boost::phoenix::composite<boost::phoenix::detail::function_eval<0>,boost::fusion::vector<boost::phoenix::value<double
point::* >,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_>>,
1> Env=boost::phoenix::basic_environment<>
1> ]
1> c:\boost\boost\spirit\home\phoenix\core\actor.hpp(57) : see
reference to class template instantiation
'boost::phoenix::composite<EvalPolicy,EvalTuple>::result<Env>' being
compiled
1> with
1> [
1> EvalPolicy=boost::phoenix::detail::function_eval<0>,
1> EvalTuple=boost::fusion::vector<boost::phoenix::value<double
point::* >,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_>,
1> Env=boost::phoenix::basic_environment<>
1> ]
1> c:\boost\boost\mpl\eval_if.hpp(41) : see reference to class
template instantiation 'boost::phoenix::eval_result<Eval,Env>' being
compiled
1> with
1> [
1> Eval=boost::phoenix::composite<boost::phoenix::detail::function_eval<0>,boost::fusion::vector<boost::phoenix::value<double
point::* >,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_>>,
1> Env=boost::phoenix::basic_environment<>
1> ]
[snip]
Thanks,
Christian
On Sat, Nov 1, 2008 at 5:52 AM, Sergey Sadovnikov
<flex_ferrum_at_[hidden]> wrote:
> Hello, Christian.
>
> Saturday, November 1, 2008 at 1:15:54 AM you wrote:
>
> CH> Hi there, the following snippet doesn't compile which surprises me a
> CH> little. Could somebody tell what's wrong?
>
> Try following:
> double sum_prob = std::accumulate( d.begin()
> , d.end()
> , 0.0
> , bind( &point::_prob)(arg1)
> );
>
> --
> Best Regards,
> Sergey
>
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>
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