diff options
author | Olivier Goffart <ogoffart@trolltech.com> | 2009-04-19 19:12:21 (GMT) |
---|---|---|
committer | Olivier Goffart <olivier.goffart@nokia.com> | 2010-09-03 10:57:10 (GMT) |
commit | da0e1a682362144b9f13b4c564f86e09efb681bb (patch) | |
tree | 8cbf68a93b055515b2a56d9e0667c530b27e39e2 /src/corelib/tools/qset.h | |
parent | 605aa0cf1889110620dc0d5d84066be8177fe9c2 (diff) | |
download | Qt-da0e1a682362144b9f13b4c564f86e09efb681bb.zip Qt-da0e1a682362144b9f13b4c564f86e09efb681bb.tar.gz Qt-da0e1a682362144b9f13b4c564f86e09efb681bb.tar.bz2 |
C++0x move operators
This makes assignement faster from temporaries, as the operator is
fully inline, and doesn't do any atomic operations.
Reviewed-by: joao
Diffstat (limited to 'src/corelib/tools/qset.h')
-rw-r--r-- | src/corelib/tools/qset.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/corelib/tools/qset.h b/src/corelib/tools/qset.h index fe50d4d..dc3c45a 100644 --- a/src/corelib/tools/qset.h +++ b/src/corelib/tools/qset.h @@ -61,6 +61,10 @@ public: inline QSet<T> &operator=(const QSet<T> &other) { q_hash = other.q_hash; return *this; } +#ifdef Q_COMPILER_RVALUE_REFS + inline QSet<T> &operator=(QSet<T> &&other) + { qSwap(q_hash, other.q_hash); return *this; } +#endif inline bool operator==(const QSet<T> &other) const { return q_hash == other.q_hash; } |