
Joel,
See spirit/phoenix/test/algorithm for some examples. For example:
void accumulate_test() { using namespace boost::phoenix; using namespace boost::phoenix::arg_names; int array[] = {1,2,3}; BOOST_TEST(accumulate(arg1, 0)(array) == 6); BOOST_TEST(boost::phoenix::accumulate( arg1, 0, std::minus<int>())(array) == -6); return; }
I know about that example. I was interested in how I can use that phoenix::accumulate when iterating over my _prob? In essence how can I rewrite the following code to use phoenix's version of accumulate? std::vector< point > d; double sum_prob = std::accumulate( d.begin() , d.end() , 0.0 , bind( &point::_prob, arg2 ) ); Thanks, Christian