Remove the unnecessary comment about operator== not being necessary
authorThiago Macieira <thiago.macieira@intel.com>
Fri, 25 May 2012 09:51:48 +0000 (11:51 +0200)
committerQt by Nokia <qt-info@nokia.com>
Thu, 31 May 2012 15:57:50 +0000 (17:57 +0200)
The mysterious comment was just suggesting that they weren't
necessary. Turns out the comment is wrong: they are necessary for
non-strict iterator modes.

Task-number: QTBUG-25063
Change-Id: I20ada17035642ee656c431d6bf2152a5243cecdb
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
src/corelib/tools/qhash.h
src/corelib/tools/qmap.h

index 93af8f6..c0e2e6e 100644 (file)
@@ -378,16 +378,13 @@ public:
         inline iterator &operator+=(int j) { return *this = *this + j; }
         inline iterator &operator-=(int j) { return *this = *this - j; }
 
-        // ### Qt 5: not sure this is necessary anymore
-#ifdef QT_STRICT_ITERATORS
-    private:
-#else
+#ifndef QT_STRICT_ITERATORS
     public:
-#endif
         inline bool operator==(const const_iterator &o) const
             { return i == o.i; }
         inline bool operator!=(const const_iterator &o) const
             { return i != o.i; }
+#endif
     };
     friend class iterator;
 
index 3494bd0..9cab103 100644 (file)
@@ -435,15 +435,13 @@ public:
         inline iterator &operator+=(int j) { return *this = *this + j; }
         inline iterator &operator-=(int j) { return *this = *this - j; }
 
-#ifdef QT_STRICT_ITERATORS
-    private:
-#else
+#ifndef QT_STRICT_ITERATORS
     public:
-#endif
         inline bool operator==(const const_iterator &o) const
             { return i == o.i; }
         inline bool operator!=(const const_iterator &o) const
             { return i != o.i; }
+#endif
         friend class QMap<Key, T>;
     };
     friend class iterator;