Gobelijn API documentation  - generated for commit a0cbea7
 All Classes Namespaces Files Functions Variables Typedefs Friends Macros Pages
accum2.hpp
Go to the documentation of this file.
1 #pragma once
2 
8 #include "accumtraits2.hpp"
9 
10 template <typename T>
11 inline typename AccumulationTraits<T>::type accum(const T* beg, const T* end)
12 {
13  using AccT = typename AccumulationTraits<T>::type;
14 
15  AccT total = AccT();
16  while (beg != end) {
17  total += *beg;
18  ++beg;
19  }
20  return total;
21 }
AccumulationTraits< T >::type accum(const T *beg, const T *end)
Definition: accum2.hpp:11