File indexing completed on 2026-05-03 08:13:19
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef _LIBCPP___CXX03___ALGORITHM_RANGES_FIND_END_H
0010 #define _LIBCPP___CXX03___ALGORITHM_RANGES_FIND_END_H
0011
0012 #include <__cxx03/__algorithm/find_end.h>
0013 #include <__cxx03/__algorithm/iterator_operations.h>
0014 #include <__cxx03/__algorithm/ranges_iterator_concept.h>
0015 #include <__cxx03/__config>
0016 #include <__cxx03/__functional/identity.h>
0017 #include <__cxx03/__functional/ranges_operations.h>
0018 #include <__cxx03/__iterator/concepts.h>
0019 #include <__cxx03/__iterator/indirectly_comparable.h>
0020 #include <__cxx03/__iterator/iterator_traits.h>
0021 #include <__cxx03/__ranges/access.h>
0022 #include <__cxx03/__ranges/concepts.h>
0023 #include <__cxx03/__ranges/subrange.h>
0024 #include <__cxx03/__utility/pair.h>
0025
0026 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
0027 # pragma GCC system_header
0028 #endif
0029
0030 _LIBCPP_PUSH_MACROS
0031 #include <__cxx03/__undef_macros>
0032
0033 #if _LIBCPP_STD_VER >= 20
0034
0035 _LIBCPP_BEGIN_NAMESPACE_STD
0036
0037 namespace ranges {
0038 namespace __find_end {
0039 struct __fn {
0040 template <forward_iterator _Iter1,
0041 sentinel_for<_Iter1> _Sent1,
0042 forward_iterator _Iter2,
0043 sentinel_for<_Iter2> _Sent2,
0044 class _Pred = ranges::equal_to,
0045 class _Proj1 = identity,
0046 class _Proj2 = identity>
0047 requires indirectly_comparable<_Iter1, _Iter2, _Pred, _Proj1, _Proj2>
0048 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr subrange<_Iter1> operator()(
0049 _Iter1 __first1,
0050 _Sent1 __last1,
0051 _Iter2 __first2,
0052 _Sent2 __last2,
0053 _Pred __pred = {},
0054 _Proj1 __proj1 = {},
0055 _Proj2 __proj2 = {}) const {
0056 auto __ret = std::__find_end_impl<_RangeAlgPolicy>(
0057 __first1,
0058 __last1,
0059 __first2,
0060 __last2,
0061 __pred,
0062 __proj1,
0063 __proj2,
0064 __iterator_concept<_Iter1>(),
0065 __iterator_concept<_Iter2>());
0066 return {__ret.first, __ret.second};
0067 }
0068
0069 template <forward_range _Range1,
0070 forward_range _Range2,
0071 class _Pred = ranges::equal_to,
0072 class _Proj1 = identity,
0073 class _Proj2 = identity>
0074 requires indirectly_comparable<iterator_t<_Range1>, iterator_t<_Range2>, _Pred, _Proj1, _Proj2>
0075 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr borrowed_subrange_t<_Range1> operator()(
0076 _Range1&& __range1, _Range2&& __range2, _Pred __pred = {}, _Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const {
0077 auto __ret = std::__find_end_impl<_RangeAlgPolicy>(
0078 ranges::begin(__range1),
0079 ranges::end(__range1),
0080 ranges::begin(__range2),
0081 ranges::end(__range2),
0082 __pred,
0083 __proj1,
0084 __proj2,
0085 __iterator_concept<iterator_t<_Range1>>(),
0086 __iterator_concept<iterator_t<_Range2>>());
0087 return {__ret.first, __ret.second};
0088 }
0089 };
0090 }
0091
0092 inline namespace __cpo {
0093 inline constexpr auto find_end = __find_end::__fn{};
0094 }
0095 }
0096
0097 _LIBCPP_END_NAMESPACE_STD
0098
0099 #endif
0100
0101 _LIBCPP_POP_MACROS
0102
0103 #endif