Skip to content

Instantly share code, notes, and snippets.

@shintakezou
Created March 30, 2012 21:25
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 shintakezou/2255247 to your computer and use it in GitHub Desktop.
Save shintakezou/2255247 to your computer and use it in GitHub Desktop.
fold left, lambda in C++11, no boilerplate code
accumulate(array.begin(),
array.end(), 0,
[](const int& x, const int& y) -> int { return x + y*2; })
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment