]> granicus.if.org Git - icu/commitdiff
ICU-21819 Make all comparison operators const.
authorFredrik Roubert <roubert@google.com>
Wed, 16 Sep 2020 15:40:42 +0000 (17:40 +0200)
committerFredrik Roubert <fredrik@roubert.name>
Mon, 22 Nov 2021 14:11:11 +0000 (15:11 +0100)
icu4c/source/common/uvectr32.cpp
icu4c/source/common/uvectr32.h

index a77ecb689fdaadbb3d621e48aebc76c5589552b3..2b4d0b8a75a3652489770ff3acd7b3b5ceb5e16d 100644 (file)
@@ -83,7 +83,7 @@ void UVector32::assign(const UVector32& other, UErrorCode &ec) {
 }
 
 
-bool UVector32::operator==(const UVector32& other) {
+bool UVector32::operator==(const UVector32& other) const {
     int32_t i;
     if (count != other.count) return false;
     for (i=0; i<count; ++i) {
index f08c2ade7655ad37c071a3b5247620fb111d6666..ecefb7af3ea8809d5c4b1436ce2b92ce36661d1e 100644 (file)
@@ -86,12 +86,12 @@ public:
      * equal if they are of the same size and all elements are equal,
      * as compared using this object's comparer.
      */
-    bool operator==(const UVector32& other);
+    bool operator==(const UVector32& other) const;
 
     /**
      * Equivalent to !operator==()
      */
-    inline bool operator!=(const UVector32& other);
+    inline bool operator!=(const UVector32& other) const;
 
     //------------------------------------------------------------
     // java.util.Vector API
@@ -268,7 +268,7 @@ inline int32_t UVector32::lastElementi(void) const {
     return elementAti(count-1);
 }
 
-inline bool UVector32::operator!=(const UVector32& other) {
+inline bool UVector32::operator!=(const UVector32& other) const {
     return !operator==(other);
 }