[lld][WebAssembly] Reinstate mistakenly disabled test. NFC
[llvm-project.git] / libcxx / include / __functional / ranges_operations.h
blob777c5352510294c3229f73fca274e0d58bb87369
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 //===----------------------------------------------------------------------===//
10 #ifndef _LIBCPP___FUNCTIONAL_RANGES_OPERATIONS_H
11 #define _LIBCPP___FUNCTIONAL_RANGES_OPERATIONS_H
13 #include <__config>
14 #include <concepts>
15 #include <utility>
17 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
18 #pragma GCC system_header
19 #endif
21 _LIBCPP_BEGIN_NAMESPACE_STD
23 #if !defined(_LIBCPP_HAS_NO_RANGES)
24 namespace ranges {
26 struct equal_to {
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;
37 struct not_equal_to {
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;
48 struct less {
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;
59 struct less_equal {
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;
70 struct greater {
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;
92 } // namespace ranges
93 #endif // !defined(_LIBCPP_HAS_NO_RANGES)
95 _LIBCPP_END_NAMESPACE_STD
97 #endif // _LIBCPP___FUNCTIONAL_RANGES_OPERATIONS_H