On Tue, Jan 20, 2009 at 2:53 PM, Maxim Koshelev <chuchelo@gmail.com> wrote:
> The Lambda version would be similar, just replacing the outer bind with
> infix notation
>
> #include "boost/lambda/lambda.hpp"
> #include "boost/lambda/bind.hpp"
>
> using namespace boost::lambda;
>
> std::accumulate( begin, end, _1 + bind(&A::a, _2 ));
>
> Again untested.

this std::accumulate return complicated lambda function, but not int value :-)


Yeah, sorry, missed the initial value!

std::accumulate( begin, end, 0, _1 + bind(&A::a, _2 ));