|
3 | 3 |
|
4 | 4 | // SPDX-License-Identifier: MIT |
5 | 5 |
|
6 | | -#include <utility> |
| 6 | +#include <iris/config.hpp> // IWYU pragma: keep |
| 7 | + |
| 8 | +#include <iris/alloy/detail/std_get.hpp> |
| 9 | + |
| 10 | +#include <utility> // IWYU pragma: export |
| 11 | + |
| 12 | +#include <cstddef> |
7 | 13 |
|
8 | 14 | namespace iris::alloy { |
9 | 15 |
|
10 | | -namespace detail { |
| 16 | +template<class T> |
| 17 | +struct tuple_size; |
| 18 | + |
| 19 | +template<class T, class U> |
| 20 | +struct tuple_size<std::pair<T, U>> : std::integral_constant<std::size_t, 2> |
| 21 | +{}; |
| 22 | + |
| 23 | +template<class T, class U> |
| 24 | +struct tuple_size<std::pair<T, U> const> : std::integral_constant<std::size_t, 2> |
| 25 | +{}; |
| 26 | + |
| 27 | +template<class T, class U> |
| 28 | +struct tuple_size<std::pair<T, U> volatile> : std::integral_constant<std::size_t, 2> |
| 29 | +{}; |
| 30 | + |
| 31 | +template<class T, class U> |
| 32 | +struct tuple_size<std::pair<T, U> const volatile> : std::integral_constant<std::size_t, 2> |
| 33 | +{}; |
| 34 | + |
| 35 | +template<std::size_t I, class Tuple> |
| 36 | +struct tuple_element; |
| 37 | + |
| 38 | +template<std::size_t I, class T, class U> |
| 39 | +struct tuple_element<I, std::pair<T, U>> : std::tuple_element<I, std::pair<T, U>> |
| 40 | +{}; |
| 41 | + |
| 42 | +template<std::size_t I, class T, class U> |
| 43 | +struct tuple_element<I, std::pair<T, U> const> : std::tuple_element<I, std::pair<T, U> const> |
| 44 | +{}; |
| 45 | + |
| 46 | +template<std::size_t I, class T, class U> |
| 47 | +struct tuple_element<I, std::pair<T, U> volatile> : std::tuple_element<I, std::pair<T, U> volatile> |
| 48 | +{}; |
11 | 49 |
|
12 | | -template<auto... Vs> |
13 | | -struct non_type_list; |
| 50 | +template<std::size_t I, class T, class U> |
| 51 | +struct tuple_element<I, std::pair<T, U> const volatile> : std::tuple_element<I, std::pair<T, U> const volatile> |
| 52 | +{}; |
14 | 53 |
|
15 | | -} // detail |
16 | 54 |
|
17 | 55 | template<class T> |
18 | 56 | struct adaptor; |
19 | 57 |
|
20 | 58 | template<class T, class U> |
21 | 59 | struct adaptor<std::pair<T, U>> |
22 | 60 | { |
23 | | - using getters_list = detail::non_type_list<&std::pair<T, U>::first, &std::pair<T, U>::second>; |
| 61 | + using getters_list = detail::call_std_get<std::index_sequence<0, 1>>::type; |
24 | 62 | }; |
25 | 63 |
|
26 | 64 | } // iris::alloy |
|
0 commit comments