blob: 9f5cf64edab766380478306f6c68be264caa3632 (
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
33
34
35
36
37
38
39
40
41
42
43
|
// The Art of C++ / Sequences
// Copyright (c) 2015 Daniel Frey
#ifndef TAOCPP_SEQUENCES_INCLUDE_INTEGER_SEQUENCE_HPP
#define TAOCPP_SEQUENCES_INCLUDE_INTEGER_SEQUENCE_HPP
#include <cstddef>
#include <utility>
#include "config.hpp"
namespace tao
{
namespace seq
{
#ifdef TAOCPP_USE_STD_INTEGER_SEQUENCE
using std::integer_sequence;
using std::index_sequence;
#else
template< typename T, T... Ns >
struct integer_sequence
{
using value_type = T;
static constexpr std::size_t size() noexcept
{
return sizeof...( Ns );
}
};
template< std::size_t... Ns >
using index_sequence = integer_sequence< std::size_t, Ns... >;
#endif
}
}
#endif // TAOCPP_SEQUENCES_INCLUDE_INTEGER_SEQUENCE_HPP
|