Created
March 9, 2014 05:41
-
-
Save mryoshio/9443343 to your computer and use it in GitHub Desktop.
sum.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template<typename Container, typename Value> | |
Value sum(const Container& c, Value v) | |
{ | |
for (auto x : c) | |
v += x; | |
return v; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A Tour of C++ 5.5