Created
December 22, 2016 21:54
-
-
Save deque-blog/b5edad5a765933db6fba82ab761e9a42 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 Iterator, typename Value, typename Accumulator> | |
Value accumulate_iter(Iterator first, Iterator last, | |
Value val, Accumulator fct) | |
{ | |
for (; first != last; ++first) | |
val = fct(val, first); | |
return val; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment