QPair: remove user-defined copy assignment operator
authorMarc Mutz <marc.mutz@kdab.com>
Tue, 28 Feb 2012 21:06:36 +0000 (22:06 +0100)
committerQt by Nokia <qt-info@nokia.com>
Tue, 28 Feb 2012 23:05:38 +0000 (00:05 +0100)
The compiler-generated copy assignment operator is fine,
and the user-defined one prevents the compiler from
synthesising a move assignment operator.

Change-Id: I044104a2fd4d7522a910d5c2a68d11dabeca99c4
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
src/corelib/tools/qpair.h

index 501f2af..064a750 100644 (file)
@@ -57,9 +57,7 @@ struct QPair
 
     QPair() : first(T1()), second(T2()) {}
     QPair(const T1 &t1, const T2 &t2) : first(t1), second(t2) {}
-
-    QPair<T1, T2> &operator=(const QPair<T1, T2> &other)
-    { first = other.first; second = other.second; return *this; }
+    // compiler-generated copy/move ctor/assignment operators are fine!
 
     T1 first;
     T2 second;