xref: /freebsd/contrib/llvm-project/libcxx/include/__utility/rel_ops.h (revision e9e8876a4d6afc1ad5315faaa191b25121a813d7)
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_PUSH_MACROS
22 #include <__undef_macros>
23 
24 _LIBCPP_BEGIN_NAMESPACE_STD
25 
26 namespace rel_ops
27 {
28 
29 template<class _Tp>
30 inline _LIBCPP_INLINE_VISIBILITY
31 bool
32 operator!=(const _Tp& __x, const _Tp& __y)
33 {
34     return !(__x == __y);
35 }
36 
37 template<class _Tp>
38 inline _LIBCPP_INLINE_VISIBILITY
39 bool
40 operator> (const _Tp& __x, const _Tp& __y)
41 {
42     return __y < __x;
43 }
44 
45 template<class _Tp>
46 inline _LIBCPP_INLINE_VISIBILITY
47 bool
48 operator<=(const _Tp& __x, const _Tp& __y)
49 {
50     return !(__y < __x);
51 }
52 
53 template<class _Tp>
54 inline _LIBCPP_INLINE_VISIBILITY
55 bool
56 operator>=(const _Tp& __x, const _Tp& __y)
57 {
58     return !(__x < __y);
59 }
60 
61 }  // rel_ops
62 
63 _LIBCPP_END_NAMESPACE_STD
64 
65 _LIBCPP_POP_MACROS
66 
67 #endif // _LIBCPP___UTILITY_REL_OPS_H
68