[rtsan] Remove mkfifoat interceptor (#116997)
[llvm-project.git] / libcxx / include / __cxx03 / __algorithm / ranges_equal_range.h
blobd6a38e5edd3127d0d4504e28380a8da419e8d2c8
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_EQUAL_RANGE_H
10 #define _LIBCPP___ALGORITHM_RANGES_EQUAL_RANGE_H
12 #include <__cxx03/__algorithm/equal_range.h>
13 #include <__cxx03/__algorithm/iterator_operations.h>
14 #include <__cxx03/__config>
15 #include <__cxx03/__functional/identity.h>
16 #include <__cxx03/__functional/invoke.h>
17 #include <__cxx03/__functional/ranges_operations.h>
18 #include <__cxx03/__iterator/concepts.h>
19 #include <__cxx03/__iterator/iterator_traits.h>
20 #include <__cxx03/__iterator/projected.h>
21 #include <__cxx03/__ranges/access.h>
22 #include <__cxx03/__ranges/concepts.h>
23 #include <__cxx03/__ranges/dangling.h>
24 #include <__cxx03/__ranges/subrange.h>
25 #include <__cxx03/__utility/forward.h>
26 #include <__cxx03/__utility/move.h>
27 #include <__cxx03/__utility/pair.h>
29 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
30 # pragma GCC system_header
31 #endif
33 _LIBCPP_PUSH_MACROS
34 #include <__cxx03/__undef_macros>
36 #if _LIBCPP_STD_VER >= 20
38 _LIBCPP_BEGIN_NAMESPACE_STD
40 namespace ranges {
41 namespace __equal_range {
43 struct __fn {
44 template <forward_iterator _Iter,
45 sentinel_for<_Iter> _Sent,
46 class _Tp,
47 class _Proj = identity,
48 indirect_strict_weak_order<const _Tp*, projected<_Iter, _Proj>> _Comp = ranges::less>
49 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr subrange<_Iter>
50 operator()(_Iter __first, _Sent __last, const _Tp& __value, _Comp __comp = {}, _Proj __proj = {}) const {
51 auto __ret = std::__equal_range<_RangeAlgPolicy>(std::move(__first), std::move(__last), __value, __comp, __proj);
52 return {std::move(__ret.first), std::move(__ret.second)};
55 template <forward_range _Range,
56 class _Tp,
57 class _Proj = identity,
58 indirect_strict_weak_order<const _Tp*, projected<iterator_t<_Range>, _Proj>> _Comp = ranges::less>
59 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr borrowed_subrange_t<_Range>
60 operator()(_Range&& __range, const _Tp& __value, _Comp __comp = {}, _Proj __proj = {}) const {
61 auto __ret =
62 std::__equal_range<_RangeAlgPolicy>(ranges::begin(__range), ranges::end(__range), __value, __comp, __proj);
63 return {std::move(__ret.first), std::move(__ret.second)};
67 } // namespace __equal_range
69 inline namespace __cpo {
70 inline constexpr auto equal_range = __equal_range::__fn{};
71 } // namespace __cpo
72 } // namespace ranges
74 _LIBCPP_END_NAMESPACE_STD
76 #endif // _LIBCPP_STD_VER >= 20
78 _LIBCPP_POP_MACROS
80 #endif // _LIBCPP___ALGORITHM_RANGES_EQUAL_RANGE_H