Skip to content

Instantly share code, notes, and snippets.

@fabiogaluppo
Created December 7, 2015 23:11
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 fabiogaluppo/de025a6721474e16e99e to your computer and use it in GitHub Desktop.
Save fabiogaluppo/de025a6721474e16e99e to your computer and use it in GitHub Desktop.
bool equals = std::accumulate(xs.begin(), xs.end(), 0) == std::accumulate(xs.rbegin(), xs.rend(), 0);
std::cout << equals << "\n"; //1 == true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment