Saturday, December 4, 2010

reverse_iterator

If you have a vector with numbers 0 through 9 in it, and a vector::reverse_iterator ri; pointing to the number 5, vectoriterator ri.base() is pointing 6.

Many STL algorithms will not take a reverse_iterator as an argument, so you have to convert it to an iterator. To do this you must increment it then convert it using the base() member

function or convert it using the base() member function, then decrement the result.

No comments:

Post a Comment