[rtsan] Remove mkfifoat interceptor (#116997)
[llvm-project.git] / libcxx / include / __cxx03 / __algorithm / ranges_starts_with.h
blob0e2424a0d8a03216357775f39d29c4eb4aaf3efa
1 //===----------------------------------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
9 #ifndef _LIBCPP___ALGORITHM_RANGES_STARTS_WITH_H
10 #define _LIBCPP___ALGORITHM_RANGES_STARTS_WITH_H
12 #include <__cxx03/__algorithm/in_in_result.h>
13 #include <__cxx03/__algorithm/ranges_mismatch.h>
14 #include <__cxx03/__config>
15 #include <__cxx03/__functional/identity.h>
16 #include <__cxx03/__functional/ranges_operations.h>
17 #include <__cxx03/__iterator/concepts.h>
18 #include <__cxx03/__iterator/indirectly_comparable.h>
19 #include <__cxx03/__ranges/access.h>
20 #include <__cxx03/__ranges/concepts.h>
21 #include <__cxx03/__utility/move.h>
23 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
24 # pragma GCC system_header
25 #endif
27 _LIBCPP_PUSH_MACROS
28 #include <__cxx03/__undef_macros>
30 #if _LIBCPP_STD_VER >= 23
32 _LIBCPP_BEGIN_NAMESPACE_STD
34 namespace ranges {
35 namespace __starts_with {
36 struct __fn {
37 template <input_iterator _Iter1,
38 sentinel_for<_Iter1> _Sent1,
39 input_iterator _Iter2,
40 sentinel_for<_Iter2> _Sent2,
41 class _Pred = ranges::equal_to,
42 class _Proj1 = identity,
43 class _Proj2 = identity>
44 requires indirectly_comparable<_Iter1, _Iter2, _Pred, _Proj1, _Proj2>
45 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static constexpr bool operator()(
46 _Iter1 __first1,
47 _Sent1 __last1,
48 _Iter2 __first2,
49 _Sent2 __last2,
50 _Pred __pred = {},
51 _Proj1 __proj1 = {},
52 _Proj2 __proj2 = {}) {
53 return __mismatch::__fn::__go(
54 std::move(__first1),
55 std::move(__last1),
56 std::move(__first2),
57 std::move(__last2),
58 __pred,
59 __proj1,
60 __proj2)
61 .in2 == __last2;
64 template <input_range _Range1,
65 input_range _Range2,
66 class _Pred = ranges::equal_to,
67 class _Proj1 = identity,
68 class _Proj2 = identity>
69 requires indirectly_comparable<iterator_t<_Range1>, iterator_t<_Range2>, _Pred, _Proj1, _Proj2>
70 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static constexpr bool
71 operator()(_Range1&& __range1, _Range2&& __range2, _Pred __pred = {}, _Proj1 __proj1 = {}, _Proj2 __proj2 = {}) {
72 return __mismatch::__fn::__go(
73 ranges::begin(__range1),
74 ranges::end(__range1),
75 ranges::begin(__range2),
76 ranges::end(__range2),
77 __pred,
78 __proj1,
79 __proj2)
80 .in2 == ranges::end(__range2);
83 } // namespace __starts_with
84 inline namespace __cpo {
85 inline constexpr auto starts_with = __starts_with::__fn{};
86 } // namespace __cpo
87 } // namespace ranges
89 _LIBCPP_END_NAMESPACE_STD
91 #endif // _LIBCPP_STD_VER >= 23
93 _LIBCPP_POP_MACROS
95 #endif // _LIBCPP___ALGORITHM_RANGES_STARTS_WITH_H