Skip to content

Instantly share code, notes, and snippets.

@ilpropheta
Last active June 23, 2016 19:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ilpropheta/650b1d99b0ae12158e46440b9d5adad3 to your computer and use it in GitHub Desktop.
Save ilpropheta/650b1d99b0ae12158e46440b9d5adad3 to your computer and use it in GitHub Desktop.
string toCheck(S.size()-1, 0); // all but one
auto newBegin = copy(begin(S), diffIt, begin(toCheck));
copy(next(diffIt), end(S), newBegin);
// or, by inlining the second call to copy:
string toCheck(S.size()-1); // all but one
copy(next(diffIt), end(S), copy(begin(S), diffIt, begin(toCheck)));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment