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 #ifndef _LIBCPP___ITERATOR_PROJECTED_H
10 #define _LIBCPP___ITERATOR_PROJECTED_H
11 
12 #include <__config>
13 #include <__iterator/concepts.h>
14 #include <__iterator/indirect_concepts.h>
15 #include <__iterator/incrementable_traits.h>
16 #include <type_traits>
17 
18 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
19 #pragma GCC system_header
20 #endif
21 
22 _LIBCPP_PUSH_MACROS
23 #include <__undef_macros>
24 
25 _LIBCPP_BEGIN_NAMESPACE_STD
26 
27 #if !defined(_LIBCPP_HAS_NO_RANGES)
28 
29 template<indirectly_readable _It, indirectly_regular_unary_invocable<_It> _Proj>
30 struct projected {
31   using value_type = remove_cvref_t<indirect_result_t<_Proj&, _It>>;
32   indirect_result_t<_Proj&, _It> operator*() const; // not defined
33 };
34 
35 template<weakly_incrementable _It, class _Proj>
36 struct incrementable_traits<projected<_It, _Proj>> {
37   using difference_type = iter_difference_t<_It>;
38 };
39 
40 #endif // !defined(_LIBCPP_HAS_NO_RANGES)
41 
42 _LIBCPP_END_NAMESPACE_STD
43 
44 _LIBCPP_POP_MACROS
45 
46 #endif // _LIBCPP___ITERATOR_PROJECTED_H
47