Skip to content

Instantly share code, notes, and snippets.

@ilpropheta
Created June 4, 2016 13:36
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/2231c619f2fa190603b8f6caa9060b49 to your computer and use it in GitHub Desktop.
Save ilpropheta/2231c619f2fa190603b8f6caa9060b49 to your computer and use it in GitHub Desktop.
const string number = "1234";
auto toUInt = accumulate(begin(number), end(number), 0u, [](unsigned curr, char nxt){
return curr * 10u + nxt - '0';
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment