forked from taocpp/sequences
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmap.hpp
31 lines (24 loc) · 738 Bytes
/
map.hpp
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
// Copyright (c) 2015-2017 Daniel Frey
// Please see LICENSE for license or visit https://github.com/taocpp/sequences/
#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