Gobelijn API documentation  - generated for commit a0cbea7
 All Classes Namespaces Files Functions Variables Typedefs Friends Macros Pages
accum10.hpp
Go to the documentation of this file.
1 #pragma once
2 
8 #include <iterator>
9 
10 template <typename Iter>
11 inline typename std::iterator_traits<Iter>::value_type accum(Iter start, Iter end)
12 {
13  using VT = typename std::iterator_traits<Iter>::value_type;
14 
15  VT total = VT(); // assume VT() actually creates a zero value
16  while (start != end) {
17  total += *start;
18  ++start;
19  }
20  return total;
21 }
std::iterator_traits< Iter >::value_type accum(Iter start, Iter end)
Definition: accum10.hpp:11