summaryrefslogtreecommitdiff
path: root/deps/tao_tuple/28626e99/include/tao/seq/map.hpp
blob: e2ff85ebb872b9bfab33dd6a587afc7258291e02 (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
// The Art of C++ / Sequences
// Copyright (c) 2015 Daniel Frey

#ifndef TAOCPP_SEQUENCES_INCLUDE_MAP_HPP
#define TAOCPP_SEQUENCES_INCLUDE_MAP_HPP

#include <cstddef>
#include <utility>

#include "integer_sequence.hpp"
#include "select.hpp"

namespace tao
{
  namespace seq
  {
    template< typename, typename >
    struct map;

    template< std::size_t... Ns, typename M >
    struct map< index_sequence< Ns... >, M >
    {
      using type = integer_sequence< typename M::value_type, select< Ns, M >::value... >;
    };

    template< typename S, typename M >
    using map_t = typename map< S, M >::type;
  }
}

#endif // TAOCPP_SEQUENCES_INCLUDE_MAP_HPP