xref: /freebsd/contrib/llvm-project/libcxx/include/__utility/rel_ops.h (revision 1db9f3b21e39176dd5b67cf8ac378633b172463e)
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 
14 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
15 #  pragma GCC system_header
16 #endif
17 
18 _LIBCPP_BEGIN_NAMESPACE_STD
19 
20 namespace rel_ops {
21 
22 template <class _Tp>
23 inline _LIBCPP_HIDE_FROM_ABI bool operator!=(const _Tp& __x, const _Tp& __y) {
24   return !(__x == __y);
25 }
26 
27 template <class _Tp>
28 inline _LIBCPP_HIDE_FROM_ABI bool operator>(const _Tp& __x, const _Tp& __y) {
29   return __y < __x;
30 }
31 
32 template <class _Tp>
33 inline _LIBCPP_HIDE_FROM_ABI bool operator<=(const _Tp& __x, const _Tp& __y) {
34   return !(__y < __x);
35 }
36 
37 template <class _Tp>
38 inline _LIBCPP_HIDE_FROM_ABI bool operator>=(const _Tp& __x, const _Tp& __y) {
39   return !(__x < __y);
40 }
41 
42 } // namespace rel_ops
43 
44 _LIBCPP_END_NAMESPACE_STD
45 
46 #endif // _LIBCPP___UTILITY_REL_OPS_H
47