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

#ifndef TAOCPP_SEQUENCES_INCLUDE_SELECT_HPP
#define TAOCPP_SEQUENCES_INCLUDE_SELECT_HPP

#include <cstddef>
#include <type_traits>

#include "integer_sequence.hpp"
#include "values.hpp"

namespace tao
{
  namespace seq
  {
    template< std::size_t I, typename T, T... Ns >
    struct select
      : std::integral_constant< T, values< T, Ns... >::data[ I ] >
    {};

    template< std::size_t I, typename T, T... Ns >
    struct select< I, integer_sequence< T, Ns... > >
      : select< I, T, Ns... >
    {};
  }
}

#endif // TAOCPP_SEQUENCES_INCLUDE_SELECT_HPP