integer_sequence.hpp
Go to the documentation of this file.
1 // Copyright (C) 2020-2024 Jonathan Müller and lexy contributors
2 // SPDX-License-Identifier: BSL-1.0
3 
4 #ifndef LEXY_DETAIL_INTEGER_SEQUENCE_HPP_INCLUDED
5 #define LEXY_DETAIL_INTEGER_SEQUENCE_HPP_INCLUDED
6 
8 
9 namespace lexy::_detail
10 {
11 template <typename T, T... Indices>
13 {
14  using type = integer_sequence<T, Indices...>;
15 };
16 template <std::size_t... Indices>
17 using index_sequence = integer_sequence<std::size_t, Indices...>;
18 
19 #if defined(__clang__)
20 template <std::size_t Size>
21 using make_index_sequence = __make_integer_seq<integer_sequence, std::size_t, Size>;
22 #elif defined(__GNUC__) && __GNUC__ >= 8
23 template <std::size_t Size>
24 using make_index_sequence = index_sequence<__integer_pack(Size)...>;
25 #elif defined(_MSC_VER)
26 template <std::size_t Size>
27 using make_index_sequence = __make_integer_seq<integer_sequence, std::size_t, Size>;
28 #else
29 
30 // Adapted from https://stackoverflow.com/a/32223343.
31 template <class Sequence1, class Sequence2>
32 struct concat_seq;
33 template <std::size_t... I1, std::size_t... I2>
35 {
36  using type = index_sequence<I1..., (sizeof...(I1) + I2)...>;
37 };
38 
39 template <size_t N>
40 struct _make_index_sequence : concat_seq<typename _make_index_sequence<N / 2>::type,
41  typename _make_index_sequence<N - N / 2>::type>
42 {};
43 template <>
45 {
47 };
48 template <>
50 {
52 };
53 
54 template <std::size_t Size>
56 
57 #endif
58 
59 template <typename... T>
61 } // namespace lexy::_detail
62 
63 #endif // LEXY_DETAIL_INTEGER_SEQUENCE_HPP_INCLUDED
64 
lexy::_detail::index_sequence_for
make_index_sequence< sizeof...(T)> index_sequence_for
Definition: integer_sequence.hpp:60
config.hpp
lexy::_detail::concat_seq
Definition: integer_sequence.hpp:32
lexy::_detail::integer_sequence
Definition: integer_sequence.hpp:12
lexy::_detail::make_index_sequence
typename _make_index_sequence< Size >::type make_index_sequence
Definition: integer_sequence.hpp:55
lexy::_detail
Definition: any_ref.hpp:12
lexy::_detail::_make_index_sequence
Definition: integer_sequence.hpp:40


behaviortree_cpp_v4
Author(s): Davide Faconti
autogenerated on Fri Nov 1 2024 02:20:51