Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

7
  • 1
    Good stuff, I've recently utilized this. My Visual Studio compiler has an odd whinge until I use a whitespace to separate the two ">" characters before the tokens(text, sep) bit: (error C2947: expecting '>' to terminate template-argument-list, found '>>') Commented Oct 1, 2010 at 15:57
  • @AndyUK yes, without the space the compiler parses it as an extraction operator rather than two closing templates. Commented Jun 14, 2011 at 3:23
  • Theoretically that's been fixed in C++0x Commented Sep 1, 2011 at 2:09
  • 3
    beware of the third parameters of the char_separator constructor (drop_empty_tokens is the default, alternative is keep_empty_tokens). Commented Feb 17, 2012 at 10:56
  • 5
    @puk - It's a commonly used suffix for C++ header files. (like .h for C headers) Commented Dec 12, 2013 at 22:44