Boost logo

Boost Users :

From: Andriy Tylychko \(mail.ru\) (telya_at_[hidden])
Date: 2006-09-08 06:14:38


> 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_at_[hidden]
www.vichnavich.com


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net