xref: /freebsd/contrib/llvm-project/libcxx/include/__utility/rel_ops.h (revision ebacd8013fe5f7fdf9f6a5b286f6680dd2891036)
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 //===----------------------------------------------------------------------===//
8 
9 #ifndef _LIBCPP___UTILITY_REL_OPS_H
10 #define _LIBCPP___UTILITY_REL_OPS_H
11 
12 #include <__config>
13 #include <__utility/forward.h>
14 #include <__utility/move.h>
15 #include <type_traits>
16 
17 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
18 #  pragma GCC system_header
19 #endif
20 
21 _LIBCPP_BEGIN_NAMESPACE_STD
22 
23 namespace rel_ops
24 {
25 
26 template<class _Tp>
27 inline _LIBCPP_INLINE_VISIBILITY
28 bool
29 operator!=(const _Tp& __x, const _Tp& __y)
30 {
31     return !(__x == __y);
32 }
33 
34 template<class _Tp>
35 inline _LIBCPP_INLINE_VISIBILITY
36 bool
37 operator> (const _Tp& __x, const _Tp& __y)
38 {
39     return __y < __x;
40 }
41 
42 template<class _Tp>
43 inline _LIBCPP_INLINE_VISIBILITY
44 bool
45 operator<=(const _Tp& __x, const _Tp& __y)
46 {
47     return !(__y < __x);
48 }
49 
50 template<class _Tp>
51 inline _LIBCPP_INLINE_VISIBILITY
52 bool
53 operator>=(const _Tp& __x, const _Tp& __y)
54 {
55     return !(__x < __y);
56 }
57 
58 } // namespace rel_ops
59 
60 _LIBCPP_END_NAMESPACE_STD
61 
62 #endif // _LIBCPP___UTILITY_REL_OPS_H
63