aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArthur O'Dwyer <arthur.j.odwyer@gmail.com>2021-09-27 01:10:52 -0400
committerArthur O'Dwyer <arthur.j.odwyer@gmail.com>2021-09-28 12:23:41 -0400
commita7d084a18de736e0ed750c67c5851fa6b2a085f5 (patch)
tree8f53c37588bcbe5419c79200386adb0dadc9ca94
parentb6b7860954c677003a5a0b0d4071e88aa44e9081 (diff)
downloadllvm-a7d084a18de736e0ed750c67c5851fa6b2a085f5.zip
llvm-a7d084a18de736e0ed750c67c5851fa6b2a085f5.tar.gz
llvm-a7d084a18de736e0ed750c67c5851fa6b2a085f5.tar.bz2
[libc++] [compare] Rip out more vestiges of *_equality. NFCI.
There's really no reason to even have two different enums here, but *definitely* we shouldn't have *three*, and they don't need so many synonymous enumerator values. Differential Revision: https://reviews.llvm.org/D110516
-rw-r--r--libcxx/include/__compare/ordering.h25
1 files changed, 5 insertions, 20 deletions
diff --git a/libcxx/include/__compare/ordering.h b/libcxx/include/__compare/ordering.h
index 460d25c..f4ad31b 100644
--- a/libcxx/include/__compare/ordering.h
+++ b/libcxx/include/__compare/ordering.h
@@ -21,16 +21,9 @@ _LIBCPP_BEGIN_NAMESPACE_STD
#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_SPACESHIP_OPERATOR)
// exposition only
-enum class _LIBCPP_ENUM_VIS _EqResult : unsigned char {
- __zero = 0,
- __equal = __zero,
- __equiv = __equal,
- __nonequal = 1,
- __nonequiv = __nonequal
-};
-
enum class _LIBCPP_ENUM_VIS _OrdResult : signed char {
__less = -1,
+ __equiv = 0,
__greater = 1
};
@@ -57,10 +50,6 @@ class partial_ordering {
using _ValueT = signed char;
_LIBCPP_HIDE_FROM_ABI
- explicit constexpr partial_ordering(_EqResult __v) noexcept
- : __value_(_ValueT(__v)) {}
-
- _LIBCPP_HIDE_FROM_ABI
explicit constexpr partial_ordering(_OrdResult __v) noexcept
: __value_(_ValueT(__v)) {}
@@ -142,7 +131,7 @@ private:
};
inline constexpr partial_ordering partial_ordering::less(_OrdResult::__less);
-inline constexpr partial_ordering partial_ordering::equivalent(_EqResult::__equiv);
+inline constexpr partial_ordering partial_ordering::equivalent(_OrdResult::__equiv);
inline constexpr partial_ordering partial_ordering::greater(_OrdResult::__greater);
inline constexpr partial_ordering partial_ordering::unordered(_NCmpResult ::__unordered);
@@ -150,8 +139,6 @@ class weak_ordering {
using _ValueT = signed char;
_LIBCPP_HIDE_FROM_ABI
- explicit constexpr weak_ordering(_EqResult __v) noexcept : __value_(_ValueT(__v)) {}
- _LIBCPP_HIDE_FROM_ABI
explicit constexpr weak_ordering(_OrdResult __v) noexcept : __value_(_ValueT(__v)) {}
public:
@@ -229,15 +216,13 @@ private:
};
inline constexpr weak_ordering weak_ordering::less(_OrdResult::__less);
-inline constexpr weak_ordering weak_ordering::equivalent(_EqResult::__equiv);
+inline constexpr weak_ordering weak_ordering::equivalent(_OrdResult::__equiv);
inline constexpr weak_ordering weak_ordering::greater(_OrdResult::__greater);
class strong_ordering {
using _ValueT = signed char;
_LIBCPP_HIDE_FROM_ABI
- explicit constexpr strong_ordering(_EqResult __v) noexcept : __value_(_ValueT(__v)) {}
- _LIBCPP_HIDE_FROM_ABI
explicit constexpr strong_ordering(_OrdResult __v) noexcept : __value_(_ValueT(__v)) {}
public:
@@ -323,8 +308,8 @@ private:
};
inline constexpr strong_ordering strong_ordering::less(_OrdResult::__less);
-inline constexpr strong_ordering strong_ordering::equal(_EqResult::__equal);
-inline constexpr strong_ordering strong_ordering::equivalent(_EqResult::__equiv);
+inline constexpr strong_ordering strong_ordering::equal(_OrdResult::__equiv);
+inline constexpr strong_ordering strong_ordering::equivalent(_OrdResult::__equiv);
inline constexpr strong_ordering strong_ordering::greater(_OrdResult::__greater);
// named comparison functions