2 //===----------------------------------------------------------------------===//
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
8 //===----------------------------------------------------------------------===//
10 #ifndef _LIBCPP___FUNCTIONAL_RANGES_OPERATIONS_H
11 #define _LIBCPP___FUNCTIONAL_RANGES_OPERATIONS_H
17 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
18 #pragma GCC system_header
21 _LIBCPP_BEGIN_NAMESPACE_STD
23 #if !defined(_LIBCPP_HAS_NO_RANGES)
27 template <class _Tp
, class _Up
>
28 requires equality_comparable_with
<_Tp
, _Up
>
29 [[nodiscard
]] constexpr bool operator()(_Tp
&&__t
, _Up
&&__u
) const
30 noexcept(noexcept(bool(_VSTD::forward
<_Tp
>(__t
) == _VSTD::forward
<_Up
>(__u
)))) {
31 return _VSTD::forward
<_Tp
>(__t
) == _VSTD::forward
<_Up
>(__u
);
34 using is_transparent
= void;
38 template <class _Tp
, class _Up
>
39 requires equality_comparable_with
<_Tp
, _Up
>
40 [[nodiscard
]] constexpr bool operator()(_Tp
&&__t
, _Up
&&__u
) const
41 noexcept(noexcept(bool(!(_VSTD::forward
<_Tp
>(__t
) == _VSTD::forward
<_Up
>(__u
))))) {
42 return !(_VSTD::forward
<_Tp
>(__t
) == _VSTD::forward
<_Up
>(__u
));
45 using is_transparent
= void;
49 template <class _Tp
, class _Up
>
50 requires totally_ordered_with
<_Tp
, _Up
>
51 [[nodiscard
]] constexpr bool operator()(_Tp
&&__t
, _Up
&&__u
) const
52 noexcept(noexcept(bool(_VSTD::forward
<_Tp
>(__t
) < _VSTD::forward
<_Up
>(__u
)))) {
53 return _VSTD::forward
<_Tp
>(__t
) < _VSTD::forward
<_Up
>(__u
);
56 using is_transparent
= void;
60 template <class _Tp
, class _Up
>
61 requires totally_ordered_with
<_Tp
, _Up
>
62 [[nodiscard
]] constexpr bool operator()(_Tp
&&__t
, _Up
&&__u
) const
63 noexcept(noexcept(bool(!(_VSTD::forward
<_Up
>(__u
) < _VSTD::forward
<_Tp
>(__t
))))) {
64 return !(_VSTD::forward
<_Up
>(__u
) < _VSTD::forward
<_Tp
>(__t
));
67 using is_transparent
= void;
71 template <class _Tp
, class _Up
>
72 requires totally_ordered_with
<_Tp
, _Up
>
73 [[nodiscard
]] constexpr bool operator()(_Tp
&&__t
, _Up
&&__u
) const
74 noexcept(noexcept(bool(_VSTD::forward
<_Up
>(__u
) < _VSTD::forward
<_Tp
>(__t
)))) {
75 return _VSTD::forward
<_Up
>(__u
) < _VSTD::forward
<_Tp
>(__t
);
78 using is_transparent
= void;
81 struct greater_equal
{
82 template <class _Tp
, class _Up
>
83 requires totally_ordered_with
<_Tp
, _Up
>
84 [[nodiscard
]] constexpr bool operator()(_Tp
&&__t
, _Up
&&__u
) const
85 noexcept(noexcept(bool(!(_VSTD::forward
<_Tp
>(__t
) < _VSTD::forward
<_Up
>(__u
))))) {
86 return !(_VSTD::forward
<_Tp
>(__t
) < _VSTD::forward
<_Up
>(__u
));
89 using is_transparent
= void;
93 #endif // !defined(_LIBCPP_HAS_NO_RANGES)
95 _LIBCPP_END_NAMESPACE_STD
97 #endif // _LIBCPP___FUNCTIONAL_RANGES_OPERATIONS_H