rel_ops.h revision 1.1.1.1
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
26namespace rel_ops
27{
28
29template<class _Tp>
30inline _LIBCPP_INLINE_VISIBILITY
31bool
32operator!=(const _Tp& __x, const _Tp& __y)
33{
34    return !(__x == __y);
35}
36
37template<class _Tp>
38inline _LIBCPP_INLINE_VISIBILITY
39bool
40operator> (const _Tp& __x, const _Tp& __y)
41{
42    return __y < __x;
43}
44
45template<class _Tp>
46inline _LIBCPP_INLINE_VISIBILITY
47bool
48operator<=(const _Tp& __x, const _Tp& __y)
49{
50    return !(__y < __x);
51}
52
53template<class _Tp>
54inline _LIBCPP_INLINE_VISIBILITY
55bool
56operator>=(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