If the string was processed using the Boost tokenizer, you can get the position in the original string that this iterator token points to:
boost:tokenizer<> tok( "this is the original string" );
for(tokenizer<>::iterator it=tok.begin(); it!=tok.end();++it)
{
std::string strToken = *it;
int charPos = it.?
}
I understand that I can create a specific char_separator with a specific list of "stored delimiters" and specify keep_empty_tokens to try and track the progress of the iterator, but I was hoping there was an easier way to use only the iterator itself.
source
share