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