Removed remaining int operations from RefCount
authorJoão Abecasis <joao.abecasis@nokia.com>
Thu, 10 Nov 2011 17:19:19 +0000 (18:19 +0100)
committerQt by Nokia <qt-info@nokia.com>
Tue, 24 Jan 2012 13:10:30 +0000 (14:10 +0100)
RefCount has currently three magic values (-1 for statics, 0 for
unsharables, 1 for unshared-sharable). From the API point of view, the
individual values are not important or necessary and it's error prone
for users of the class to be fiddling with them.

Change-Id: I7037cc31d3d062abbad73d04962bc74d85ebd20f
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
src/corelib/tools/qrefcount.h

index 6983514..1d2474b 100644 (file)
@@ -101,15 +101,6 @@ public:
         return (count != 1) && (count != 0);
     }
 
-    inline bool operator==(int value) const
-    { return atomic.load() == value; }
-    inline bool operator!=(int value) const
-    { return atomic.load() != value; }
-    inline bool operator!() const
-    { return !atomic.load(); }
-    inline operator int() const
-    { return atomic.load(); }
-
     void initializeOwned() { atomic.store(1); }
     void initializeUnsharable() { atomic.store(0); }