reverse_iterator topic: You need a front-to-back traversal or a back-to-front
traversal. The reason for reverse iterators is that the standard algorithms do
not know how to iterate over a collection backwards. For example:
reverse_iterator can use base() to change a normal iterator, because all the
contain member function just receive normal iterator. such as insert and
erase. why ri.base() and ri will have step 1 advance. detail can be seen
effective stl item 28.
reverse_iteratorri= find(foo.rbegin(),foo.rend(),L’a’); foo.insert(ri.base());//youcanuseri.base()directly. //whenyouwanttoinsert. foo.erase((++ri).base());//youcan’tuseri.base()directly. //whenyouerasewhatyouwant. ri 12345 i=ri.base()