[libcxx-commits] [PATCH] D110516: [libc++] [compare] Rip out more vestiges of *_equality. NFCI.

Arthur O'Dwyer via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Sep 28 09:26:01 PDT 2021


This revision was automatically updated to reflect the committed changes.
Closed by commit rGa7d084a18de7: [libc++] [compare] Rip out more vestiges of *_equality. NFCI. (authored by arthur.j.odwyer).

Changed prior to commit:
  https://reviews.llvm.org/D110516?vs=375291&id=375611#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D110516/new/

https://reviews.llvm.org/D110516

Files:
  libcxx/include/__compare/ordering.h


Index: libcxx/include/__compare/ordering.h
===================================================================
--- libcxx/include/__compare/ordering.h
+++ libcxx/include/__compare/ordering.h
@@ -21,16 +21,9 @@
 #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
 };
 
@@ -56,10 +49,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,15 +131,13 @@
 };
 
 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);
 
 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)) {}
 
@@ -229,14 +216,12 @@
 };
 
 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)) {}
 
@@ -323,8 +308,8 @@
 };
 
 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


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D110516.375611.patch
Type: text/x-patch
Size: 2829 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20210928/030e8f5b/attachment.bin>


More information about the libcxx-commits mailing list