ICU-20973 Delete unnecessary deprecated TimeUnitFormat::operator!=().
authorFredrik Roubert <roubert@google.com>
Tue, 17 Aug 2021 13:28:19 +0000 (15:28 +0200)
committerFredrik Roubert <fredrik@roubert.name>
Wed, 18 Aug 2021 23:22:48 +0000 (01:22 +0200)
An operator!=() is already defined by a base class so this class doesn't
need to define it again and not doing so avoids a C++20 ambiguity.

This simplifies the code.

icu4c/source/i18n/unicode/tmutfmt.h

index a3b0c53bd22ed2f4f54c32c0fd3f4d1bd51cd2fd..24ba906b5ea45e576becc84ef0ae6ee9a498e0b7 100644 (file)
@@ -134,23 +134,6 @@ public:
      */
     TimeUnitFormat& operator=(const TimeUnitFormat& other);
 
-    /**
-     * Return true if the given Format objects are not semantically equal.
-     * Objects of different subclasses are considered unequal.
-     * @param other the object to be compared with.
-     * @return      true if the given Format objects are not semantically equal.
-     * @deprecated ICU 53
-     */
-    bool operator!=(const Format& other) const;
-
-#if defined(__cpp_impl_three_way_comparison) && \
-       __cpp_impl_three_way_comparison >= 201711
-    // Manually resolve C++20 reversed argument order ambiguity.
-    inline bool operator!=(const TimeUnitFormat& other) const {
-        return operator!=(static_cast<const Format&>(other));
-    }
-#endif
-
     /**
      * Set the locale used for formatting or parsing.
      * @param locale  the locale to be set
@@ -244,11 +227,6 @@ private:
     friend struct TimeUnitFormatReadSink;
 };
 
-inline bool
-TimeUnitFormat::operator!=(const Format& other) const  {
-    return !operator==(other);
-}
-
 U_NAMESPACE_END
 
 #endif /* U_HIDE_DEPRECATED_API */