diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2015-07-06 16:55:15 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2015-07-19 10:33:55 +0000 |
commit | 5c442321220e9ba7818e2eba4fa22b159b6477ab (patch) | |
tree | d4ef326c6fb5ce4d3e13289be8a839f5b4570cd0 /src/corelib/tools/qset.h | |
parent | 46c5b8661222e86dca9363b14a84b46f959149a8 (diff) |
QSet/QQueue/QStack: use compiler-generated special member functions
They do the right thing (except move special member functions
on MSVC, but that's MSVC's problem).
Change-Id: I699e1be83c0568821f8c6b84394a2713bb22e8e7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/tools/qset.h')
-rw-r--r-- | src/corelib/tools/qset.h | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/corelib/tools/qset.h b/src/corelib/tools/qset.h index 5a9c75fe07..aeba6cf68d 100644 --- a/src/corelib/tools/qset.h +++ b/src/corelib/tools/qset.h @@ -57,15 +57,9 @@ public: insert(*it); } #endif - inline QSet(const QSet<T> &other) : q_hash(other.q_hash) {} - - inline QSet<T> &operator=(const QSet<T> &other) - { q_hash = other.q_hash; return *this; } -#ifdef Q_COMPILER_RVALUE_REFS - inline QSet(QSet &&other) : q_hash(qMove(other.q_hash)) {} - inline QSet<T> &operator=(QSet<T> &&other) - { qSwap(q_hash, other.q_hash); return *this; } -#endif + // compiler-generated copy/move ctor/assignment operators are fine! + // compiler-generated destructor is fine! + inline void swap(QSet<T> &other) { q_hash.swap(other.q_hash); } inline bool operator==(const QSet<T> &other) const |