
--- At Fri, 25 Apr 2003 17:01:56 -0400, Vincent LaBella wrote:
Hello, I'm using boost::tokenizer and want to goto the last token in the sequence, so I tried
Tok::iterator last = tok.end(); last--; // error decrement not defined
last = tok.begin(); advance(last,tok.size()-1); // error size() not defined.
Is it possible to add decrement or a back() reference to tokenizer?
Probably not. The iterator is a likely a forward iterator (I havent looked at the code). Forward iterators typically have valid assignment operators (I think that's a requirement). If that's true then you can use a look-ahead technique copying the current iterator until the next is what you are looking for. Implementation left as an excercise. (Is there a standard algorithm that might fit well besides for_each()?) ...Duane