blob: 5f8d42c0b2a3661fbb3bf0ef4b954e5536a22cec [file] [log] [blame]
Stephen Hinesc6ca60f2023-05-09 02:19:22 -07001//===----------------------------------------------------------------------===//
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
20namespace rel_ops
21{
22
23template<class _Tp>
24inline _LIBCPP_INLINE_VISIBILITY
25bool
26operator!=(const _Tp& __x, const _Tp& __y)
27{
28 return !(__x == __y);
29}
30
31template<class _Tp>
32inline _LIBCPP_INLINE_VISIBILITY
33bool
34operator> (const _Tp& __x, const _Tp& __y)
35{
36 return __y < __x;
37}
38
39template<class _Tp>
40inline _LIBCPP_INLINE_VISIBILITY
41bool
42operator<=(const _Tp& __x, const _Tp& __y)
43{
44 return !(__y < __x);
45}
46
47template<class _Tp>
48inline _LIBCPP_INLINE_VISIBILITY
49bool
50operator>=(const _Tp& __x, const _Tp& __y)
51{
52 return !(__x < __y);
53}
54
55} // namespace rel_ops
56
57_LIBCPP_END_NAMESPACE_STD
58
59#endif // _LIBCPP___UTILITY_REL_OPS_H