Opened 18 years ago

Last modified 13 years ago

#315 closed Feature Requests (wontfix)

Implement operator[] for Tokenizer — at Version 1

Reported by: nobody Owned by: jsiek
Milestone: Component: tokenizer
Version: None Severity: Problem
Keywords: Cc:

Description (last modified by John Maddock)

I constantly find myself creating this structure:

tokenizer tok(str, sep);
vector<string> s;
for(tokenizer::iterator iter=tok.begin();
iter!=tok.end(); ++iter) {
  s.push_back(*iter);
}

Why not just:
tok[0];

to retrieve the first token?

(Darel Finkbeiner <darel.finkbeiner@sbcglobal.net>)

Change History (1)

comment:1 by John Maddock, 15 years ago

Description: modified (diff)
Owner: changed from John Maddock to jsiek
Severity: Problem
Status: assignednew
Note: See TracTickets for help on using tickets.