How can you split without creating strings?
You can use std::regex as defined in C ++ 0x or in C ++ 98 TR1 - this returns iterators to the string (well, behind the facade anyway) - so this is not related to copying the string. The C ++ 0x regex option supports both extraction of matches and separation (extraction of inconsistencies) - so this is a complete replacement for strtok with a lot of extra power.
std::regex
strtok
See the John Cook webpage , such as wikipedia or the Stephan T Lavavej video . You may need to use boost :: regex until C ++ 0x is more widely implemented; these two are compatible.
Using Boost Split, you cannot. An obvious (but ugly) way to split strings without copying them would be strtok (or, preferably, strtok_s ).
strtok_s
You can use a receiver, akin to llvm::StringRef , which is just a pointer to a char array and size, and does not provide the mutator with a basic sequence.
llvm::StringRef
char
However, this would mean transcoding separate logic onto itself.
Source: https://habr.com/ru/post/1337578/More articles:R Language: How to print / view summary statistics for a subset of samples? - ranalysis and structure of Java code using a tool or pluggin - javaVisit data from the Google Analytics API and gapi.class.php hourly - google-analyticsHow to call a basic overloaded method in C #? - c #phpMyAdmin, is there something you can add to sql to disable caching for this query? - mysqlCSS - odd / even table row background color - cssHow to use command line tools for Mac OS X (and UNIX) such as grep with UTF-16 files? - unixHow do I know if any changes have been made to jtextarea or not? - javaGetting the id or url of a tab and displaying it with getCurrent - javascriptHow to save a list view to display the last line - androidAll Articles