How to implement tokenizer.rbegin() and rend() for boost::tokenizer ?

Posted by Chan on Stack Overflow See other posts from Stack Overflow or by Chan
Published on 2011-01-05T22:30:10Z Indexed on 2011/01/05 22:54 UTC
Read the original article Hit count: 152

Filed under:
|

Hello everyone,

I'm playing around with boost::tokenizer however I realize that it does not support rbegin() and rend(). I would like to ask how can I add these two functions to the existing class?

This is from the boost site:

#include <iostream>
#include <string>
#include <boost/tokenizer.hpp>

using namespace std;
using namespace boost;

int main() {
 string str( "12/12/1986" );
 typedef boost::tokenizer<boost::char_separator<char>> tokenizer;
 boost::char_separator<char> sep( "/" );
 tokenizer tokens( str, sep );
 cout << *tokens.begin() << endl;
    // cout << *tokens.rbegin() << endl; How could I implement this?
 return 0;
}

© Stack Overflow or respective owner

Related posts about c++

Related posts about boost