xref: /freebsd/contrib/llvm-project/libcxx/include/__iterator/ranges_iterator_traits.h (revision 0fca6ea1d4eea4c934cfff25ac9ee8ad6fe95583)
1 // -*- C++ -*-
2 //===----------------------------------------------------------------------===//
3 //
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
7 //
8 //===----------------------------------------------------------------------===//
9 
10 #ifndef _LIBCPP___ITERATOR_RANGES_ITERATOR_TRAITS_H
11 #define _LIBCPP___ITERATOR_RANGES_ITERATOR_TRAITS_H
12 
13 #include <__config>
14 #include <__fwd/pair.h>
15 #include <__ranges/concepts.h>
16 #include <__type_traits/remove_const.h>
17 
18 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
19 #  pragma GCC system_header
20 #endif
21 
22 _LIBCPP_BEGIN_NAMESPACE_STD
23 
24 #if _LIBCPP_STD_VER >= 23
25 
26 template <ranges::input_range _Range>
27 using __range_key_type = __remove_const_t<typename ranges::range_value_t<_Range>::first_type>;
28 
29 template <ranges::input_range _Range>
30 using __range_mapped_type = typename ranges::range_value_t<_Range>::second_type;
31 
32 template <ranges::input_range _Range>
33 using __range_to_alloc_type =
34     pair<const typename ranges::range_value_t<_Range>::first_type, typename ranges::range_value_t<_Range>::second_type>;
35 
36 #endif
37 
38 _LIBCPP_END_NAMESPACE_STD
39 
40 #endif // _LIBCPP___ITERATOR_RANGES_ITERATOR_TRAITS_H
41