Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save shnya/735072 to your computer and use it in GitHub Desktop.
Save shnya/735072 to your computer and use it in GitHub Desktop.
C++ split: copy, istream_iteartor, back_inserter version
vector<string> split(const string &str){
istringstream iss(str); vector<string> res;
copy(istream_iterator<string>(iss), istream_iterator<string>(), back_inserter(res));
return res;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment