30 Nov
2003
30 Nov
'03
9:22 p.m.
Here's the situation I'm trying to remedy, boiled down: class A { public: int size() const; }; class B { public: int stretch_it(int size) const; int get_total() const; private: std::vector<A> myVec; }; int B::get_total() const { int retVal = 0; for (std::vector<A>::const_iterator it = myVec.begin(); it != myVec.end (); ++it) { retVal += stretch_it(it->size()); } return retVal; } I'd love to use std::accumulate() or equivalent instead of a hand-coded loop, but I don't know if it's possible to specify a combination of operations like I have here.... Or if the result would be readable! Any suggestions would be much appreciated! --------------------- John Wismar john.wismar@alldata.com