8 Sep
2006
8 Sep
'06
10:14 a.m.
Baranowski, Daniel
If I were writing a regular for-loop, this is how it would look: vector<MyObjClass> myVector; myVector.push_back(MyObjClass(2)); ... myVector.push_back(MyObjClass(6));
vector<MyObjClass>::iterator end = myVector.end(); vector<MyObjClass>::iterator itr; for(itr = myVector.begin(); itr != end; ++itr) { if((*itr).GetValue() == 3) ProcessingFunction(*itr); }
std::for_each(myVector.begin(), myVector.end(), boost::lambda::if_then(boost::lambda::_1 == 3, [...])); Best regards, Andriy Tylychko, telia@vichnavich.com www.vichnavich.com