How can you split without making copies of string?
3 Answers
You could use std::regex as defined in C++0x or in C++98 TR1 - this returns iterators into the string (well, behind a facade anyhow) - so it doesn't involve copying the string. The C++0x regex variant supports both extracting matches and splitting (extracting non-matches) - so it's a full replacement for strtok with lots of additional power.
See John Cook's webpage for example, wikipedia or a video by Stephan T Lavavej. You may need to use boost::regex until C++0x is more widely implemented; the two are compatible.
Comments
Using Boost Split, you can't. The obvious (but ugly) way to split strings without copying them would be strtok (or, preferably, strtok_s).