Boost logo

Boost Users :

Subject: [Boost-users] [Iterators] iterators over char *
From: Rao, Anant (Anant.Rao_at_[hidden])
Date: 2010-11-01 16:16:22


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.

The information contained in this email message and its attachments is intended only for the private and confidential use of the recipient(s) named above, unless the sender expressly agrees otherwise. Transmission of email over the Internet is not a secure communications medium. If you are requesting or have requested the transmittal of personal data, as defined in applicable privacy laws by means of email or in an attachment to email, you must select a more secure alternate means of transmittal that supports your obligations to protect such personal data. If the reader of this message is not the intended recipient and/or you have received this email in error, you must take no action based on the information in this email and you are hereby notified that any dissemination, misuse or copying or disclosure of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by email and delete the original message.



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