[libcxx-commits] [libcxx] 7a06a14 - [libc++] Remove unneeded `std::` qualifications from <compare>. NFCI.

Arthur O'Dwyer via libcxx-commits libcxx-commits at lists.llvm.org
Tue Dec 7 11:00:54 PST 2021


Author: Arthur O'Dwyer
Date: 2021-12-07T13:59:41-05:00
New Revision: 7a06a14f624d31e7ed920f254d8b733d535258cb

URL: https://github.com/llvm/llvm-project/commit/7a06a14f624d31e7ed920f254d8b733d535258cb
DIFF: https://github.com/llvm/llvm-project/commit/7a06a14f624d31e7ed920f254d8b733d535258cb.diff

LOG: [libc++] Remove unneeded `std::` qualifications from <compare>. NFCI.

Reviewed as part of D115177.

Added: 
    

Modified: 
    libcxx/include/__compare/strong_order.h
    libcxx/include/__compare/weak_order.h

Removed: 
    


################################################################################
diff  --git a/libcxx/include/__compare/strong_order.h b/libcxx/include/__compare/strong_order.h
index e49b2d45de453..42f060387d595 100644
--- a/libcxx/include/__compare/strong_order.h
+++ b/libcxx/include/__compare/strong_order.h
@@ -86,11 +86,11 @@ namespace __strong_order {
                 bool __u_is_nan = _VSTD::isnan(__u);
                 bool __t_is_negative = _VSTD::signbit(__t);
                 bool __u_is_negative = _VSTD::signbit(__u);
-                using _IntType = std::conditional_t<
-                    sizeof(__t) == sizeof(int32_t), int32_t, std::conditional_t<
+                using _IntType = conditional_t<
+                    sizeof(__t) == sizeof(int32_t), int32_t, conditional_t<
                     sizeof(__t) == sizeof(int64_t), int64_t, void>
                 >;
-                if constexpr (std::is_same_v<_IntType, void>) {
+                if constexpr (is_same_v<_IntType, void>) {
                     static_assert(sizeof(_Dp) == 0, "std::strong_order is unimplemented for this floating-point type");
                 } else if (__t_is_nan && __u_is_nan) {
                     // Order by sign bit, then by "payload bits" (we'll just use bit_cast).

diff  --git a/libcxx/include/__compare/weak_order.h b/libcxx/include/__compare/weak_order.h
index f67416ed3ebe1..ce914b232108a 100644
--- a/libcxx/include/__compare/weak_order.h
+++ b/libcxx/include/__compare/weak_order.h
@@ -42,13 +42,13 @@ namespace __weak_order {
         _LIBCPP_HIDE_FROM_ABI static constexpr weak_ordering
         __go(_Tp&& __t, _Up&& __u, __priority_tag<2>) noexcept
         {
-            std::partial_ordering __po = (__t <=> __u);
-            if (__po == std::partial_ordering::less) {
-                return std::weak_ordering::less;
-            } else if (__po == std::partial_ordering::equivalent) {
-                return std::weak_ordering::equivalent;
-            } else if (__po == std::partial_ordering::greater) {
-                return std::weak_ordering::greater;
+            partial_ordering __po = (__t <=> __u);
+            if (__po == partial_ordering::less) {
+                return weak_ordering::less;
+            } else if (__po == partial_ordering::equivalent) {
+                return weak_ordering::equivalent;
+            } else if (__po == partial_ordering::greater) {
+                return weak_ordering::greater;
             } else {
                 // Otherwise, at least one of them is a NaN.
                 bool __t_is_nan = _VSTD::isnan(__t);


        


More information about the libcxx-commits mailing list