Created
April 30, 2017 14:32
-
-
Save deque-blog/9d1f49bf178b0fb52a6fe797298ba0a2 to your computer and use it in GitHub Desktop.
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> | |
int average(Container const& coll) | |
{ | |
return std::accumulate(begin(coll), end(coll), 0, std::plus<int>{}) / coll.size(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment