Hi,
I have a ‘char *’. I
need to be able to traverse thru the string in both fwd and reverse directions.
Say, I have a string ‘world’.
I will start with a fwd iter pointing at ‘w’ and start traversing.
When I reach the letter ‘r’, I might need to start traversing in
the backward direction i.e., the next char should be ‘o’ and I
might again need to traverse fwd.
In other words, the iter should
be easily convertible between the two directions. (If it could be done with
relatively low cost, that’s all the more better.)
Thanks so much in advance,
Anant
Ps:
I looked at range - str_rbegin, str_rend. Also, David
Abraham et al’s pdf doc on reverse iterator. I still didn’t
understand how to get a nice iter that traverses both directions easily. I have
a big gap in the understanding - I am not sure if I need to use a range here or
boost::reverse_iterator or …
Thanks
again.