2 //===----------------------------------------------------------------------===//
4 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5 // See https://llvm.org/LICENSE.txt for license information.
6 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
8 //===----------------------------------------------------------------------===//
10 #ifndef _LIBCPP___ITERATOR_RANGES_ITERATOR_TRAITS_H
11 #define _LIBCPP___ITERATOR_RANGES_ITERATOR_TRAITS_H
14 #include <__fwd/pair.h>
15 #include <__ranges/concepts.h>
16 #include <__type_traits/add_const.h>
17 #include <__type_traits/remove_const.h>
19 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
20 # pragma GCC system_header
23 _LIBCPP_BEGIN_NAMESPACE_STD
25 #if _LIBCPP_STD_VER >= 23
27 template <ranges::input_range _Range
>
28 using __range_key_type
= __remove_const_t
<typename
ranges::range_value_t
<_Range
>::first_type
>;
30 template <ranges::input_range _Range
>
31 using __range_mapped_type
= typename
ranges::range_value_t
<_Range
>::second_type
;
33 template <ranges::input_range _Range
>
34 using __range_to_alloc_type
=
35 pair
<add_const_t
<typename
ranges::range_value_t
<_Range
>::first_type
>,
36 typename
ranges::range_value_t
<_Range
>::second_type
>;
40 _LIBCPP_END_NAMESPACE_STD
42 #endif // _LIBCPP___ITERATOR_RANGES_ITERATOR_TRAITS_H