summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qdir.h
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@trolltech.com>2009-04-19 21:12:21 +0200
committerOlivier Goffart <olivier.goffart@nokia.com>2010-09-03 12:57:10 +0200
commitda0e1a682362144b9f13b4c564f86e09efb681bb (patch)
tree8cbf68a93b055515b2a56d9e0667c530b27e39e2 /src/corelib/io/qdir.h
parent605aa0cf1889110620dc0d5d84066be8177fe9c2 (diff)
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/io/qdir.h')
-rw-r--r--src/corelib/io/qdir.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/corelib/io/qdir.h b/src/corelib/io/qdir.h
index 28da271818..0a563044ad 100644
--- a/src/corelib/io/qdir.h
+++ b/src/corelib/io/qdir.h
@@ -129,6 +129,10 @@ public:
QDir &operator=(const QDir &);
QDir &operator=(const QString &path);
+#ifdef Q_COMPILER_RVALUE_REFS
+ inline QDir &operator=(QDir &&other)
+ { qSwap(d_ptr, other.d_ptr); return *this; }
+#endif
void setPath(const QString &path);
QString path() const;