]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/boost/poly_collection/detail/integer_sequence.hpp
Add patch for failing prerm scripts
[ceph.git] / ceph / src / boost / boost / poly_collection / detail / integer_sequence.hpp
CommitLineData
b32b8144
FG
1/* Copyright 2016 Joaquin M Lopez Munoz.
2 * Distributed under the Boost Software License, Version 1.0.
3 * (See accompanying file LICENSE_1_0.txt or copy at
4 * http://www.boost.org/LICENSE_1_0.txt)
5 *
6 * See http://www.boost.org/libs/poly_collection for library home page.
7 */
8
9#ifndef BOOST_POLY_COLLECTION_DETAIL_INTEGER_SEQUENCE_HPP
10#define BOOST_POLY_COLLECTION_DETAIL_INTEGER_SEQUENCE_HPP
11
12#if defined(_MSC_VER)
13#pragma once
14#endif
15
16#include <cstddef>
17
18namespace boost{
19
20namespace poly_collection{
21
22namespace detail{
23
24/* ripped from http://pdimov.com/cpp2/simple_cxx11_metaprogramming.html */
25
26template<typename T,T... Ints> struct integer_sequence{};
27
28template<typename S> struct next_integer_sequence;
29
30template<typename T,T... Ints>
31struct next_integer_sequence<integer_sequence<T,Ints...>>
32{
33 using type=integer_sequence<T,Ints...,sizeof...(Ints)>;
34};
35
36template<typename T,T I,T N> struct make_int_seq_impl;
37
38template<typename T,T N>
39using make_integer_sequence=typename make_int_seq_impl<T,0,N>::type;
40
41template<typename T,T I,T N> struct make_int_seq_impl
42{
43 using type=typename next_integer_sequence<
44 typename make_int_seq_impl<T,I+1,N>::type>::type;
45};
46
47template<typename T,T N> struct make_int_seq_impl<T,N,N>
48{
49 using type=integer_sequence<T>;
50};
51
52template<std::size_t... Ints>
53using index_sequence=integer_sequence<std::size_t,Ints...>;
54
55template<std::size_t N>
56using make_index_sequence=make_integer_sequence<std::size_t,N>;
57
58} /* namespace poly_collection::detail */
59
60} /* namespace poly_collection */
61
62} /* namespace boost */
63
64#endif