How can I loop thru a vector backward?
15 May
2007
15 May
'07
10:07 p.m.
Hi, I use boost library with for_each to loop thru my vector. for_each(myVector.begin(),myVector.end(), bind ( &MyClass::aFunc, this, _1) ); Can you please tell me how can i loop thru the same list in reverse? Thank you.
15 May
15 May
10:05 p.m.
Hi,
I use boost library with for_each to loop thru my vector.
for_each(myVector.begin(),myVector.end(), bind ( &MyClass::aFunc, this, _1) );
Can you please tell me how can i loop thru the same list in reverse?
for_each(myVector.rbegin(),myVector.rend(), bind ( &MyClass::aFunc, this, _1) );
10:12 p.m.
Can you please tell me how can i loop thru the same list in reverse?
check out the rbegin/rend member functions of std::vector http://www.sgi.com/tech/stl/Vector.html Chris
6394
Age (days ago)
6394
Last active (days ago)
2 comments
3 participants
participants (3)
-
Chris Weed
-
Matthias Schabel
-
Meryl Silverburgh