summaryrefslogtreecommitdiff
path: root/deps/tao_tuple/28626e99/include/tao/seq/inclusive_scan.hpp
blob: dc4bf728868d71ae18b1377734e1e31bcdee6bcb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// The Art of C++ / Sequences
// Copyright (c) 2015 Daniel Frey

#ifndef TAOCPP_SEQUENCES_INCLUDE_INCLUSIVE_SCAN_HPP
#define TAOCPP_SEQUENCES_INCLUDE_INCLUSIVE_SCAN_HPP

#include <utility>

#include "plus.hpp"
#include "exclusive_scan.hpp"
#include "integer_sequence.hpp"

namespace tao
{
  namespace seq
  {
    template< typename T, T... Ns >
    struct inclusive_scan
      : plus< exclusive_scan_t< T, Ns... >, integer_sequence< T, Ns... > >
    {};

    template< typename T, T... Ns >
    struct inclusive_scan< integer_sequence< T, Ns... > >
      : plus< exclusive_scan_t< integer_sequence< T, Ns... > >, integer_sequence< T, Ns... > >
    {};

    template< typename T, T... Ns >
    using inclusive_scan_t = typename inclusive_scan< T, Ns... >::type;
  }
}

#endif // TAOCPP_SEQUENCES_INCLUDE_INCLUSIVE_SCAN_HPP