This one IS tested!#include <vector>
#include "boost/lambda/lambda.hpp"
#include "boost/lambda/bind.hpp"
#include <numeric>
#include <iostream>int a_sum(int i, const A &v){ return i + v.a; }
struct A{
int a;
std::string b;
};
int main( )
{
using namespace boost::lambda;
std::vector<A> v;
for ( unsigned i=1; i != 6; ++i)
{
A a = { i, "" };
v.push_back( a );
}
int result = std::accumulate(v.begin(),v.end(),0, _1 + bind(&A::a,_2));
std::cout << result << "\n";
}