Gobelijn API documentation  - generated for commit a0cbea7
 All Classes Namespaces Files Functions Variables Typedefs Friends Macros Pages
accum9.hpp
Go to the documentation of this file.
1 #pragma once
2 
8 #include "accumtraits4.hpp"
9 #include "sumpolicy3.hpp"
10 
11 template <typename T, typename Policy = SumPolicy<>, typename Traits = AccumulationTraits<T>>
12 class Accum
13 {
14 public:
15  using AccT = typename Traits::type;
16  static AccT accum(const T* beg, const T* end)
17  {
18  AccT total = Traits::zero();
19  while (beg != end) {
20  Policy::accumulate(total, *beg);
21  ++beg;
22  }
23  return total;
24  }
25 };
static AccT accum(const T *beg, const T *end)
Definition: accum9.hpp:16
typename Traits::type AccT
Definition: accum6.hpp:15
Definition: accum5.hpp:11