rel_ops.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. #ifndef _LIBCPP___UTILITY_REL_OPS_H
  9. #define _LIBCPP___UTILITY_REL_OPS_H
  10. #include <__config>
  11. #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
  12. # pragma GCC system_header
  13. #endif
  14. _LIBCPP_BEGIN_NAMESPACE_STD
  15. namespace rel_ops
  16. {
  17. template<class _Tp>
  18. inline _LIBCPP_INLINE_VISIBILITY
  19. bool
  20. operator!=(const _Tp& __x, const _Tp& __y)
  21. {
  22. return !(__x == __y);
  23. }
  24. template<class _Tp>
  25. inline _LIBCPP_INLINE_VISIBILITY
  26. bool
  27. operator> (const _Tp& __x, const _Tp& __y)
  28. {
  29. return __y < __x;
  30. }
  31. template<class _Tp>
  32. inline _LIBCPP_INLINE_VISIBILITY
  33. bool
  34. operator<=(const _Tp& __x, const _Tp& __y)
  35. {
  36. return !(__y < __x);
  37. }
  38. template<class _Tp>
  39. inline _LIBCPP_INLINE_VISIBILITY
  40. bool
  41. operator>=(const _Tp& __x, const _Tp& __y)
  42. {
  43. return !(__x < __y);
  44. }
  45. } // namespace rel_ops
  46. _LIBCPP_END_NAMESPACE_STD
  47. #endif // _LIBCPP___UTILITY_REL_OPS_H