
20 Jan
2009
20 Jan
'09
1:22 p.m.
Hi again,
I have a problem. Not really big one but annoying.
Often we need to write code like this:
struct A{
int a;
std::string b;
};
int a_sum(int i, const A &v){ return v.a + i; };
std::vector<A> v;
//fill this vector somewhere
std::accumulate( v.begin(), v.end(), 0, a_sum );
or something like
int m_sum(int i, const std::pair