
2010/12/10 Rao, Anant
Hi Eric, Yes, it was a typo on my part to use ++ when I shd have had a --. But, I was talking about the compile error. That is, even if I had a '--', it would still complain. The offending line is:
while( cp != ire ) { //Do something cp--; }
Please bear with me as I (hopefully) make my requirement statement more precise:
Fwd: iterator_range
ir( &s[0], &s[ strlen(s) ] ); for (cp = (char*)ir.begin(); cp != (char*)ir.end(); ++cp) { cout << "cp in ri [" << *cp << "]\n"; }
I want similar code (using 'cp') to traverse backwards using 'ir' or another container-in-reverse mode.
The thing is, a pointer is an iterator, but an iterator is not necessarily a
pointer. The iterator returned by boost::begin(ir) happens to be char*,
because ir is an iterator_range