summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qdatetime.h
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2016-05-12 19:33:00 -0700
committerThiago Macieira <thiago.macieira@intel.com>2016-06-10 17:57:17 +0000
commitcbe62a0e6d0caba8dcb0a63d3af3c458a6298e10 (patch)
treee1c8e7eedd005708cd30784308262e5ad4800ef4 /src/corelib/tools/qdatetime.h
parent72393ac3b6a8231d1157c58fe049606dd6c95736 (diff)
Add move constructor to QDateTime
The move constructor is slightly more interesting than the copy constructor because we can reset other to a short data state on 64-bit systems. The assembly of that function is simply: mov (%rsi),%rax mov %rax,(%rdi) movq $0x1,(%rsi) retq The move-assignment operator for QDateTime was already there. There's no need for one for QDateTime::Data since it's never called. Change-Id: I06bae9392f534e45b3f1ffff144dffdd7f23b170 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/corelib/tools/qdatetime.h')
-rw-r--r--src/corelib/tools/qdatetime.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/corelib/tools/qdatetime.h b/src/corelib/tools/qdatetime.h
index 33dd20953a..0af13dd45f 100644
--- a/src/corelib/tools/qdatetime.h
+++ b/src/corelib/tools/qdatetime.h
@@ -232,8 +232,8 @@ class Q_CORE_EXPORT QDateTime
Data(Qt::TimeSpec);
Data(const Data &other);
+ Data(Data &&other);
Data &operator=(const Data &other);
- // no move semantics (would be the same as copy)
~Data();
bool isShort() const;
@@ -256,6 +256,7 @@ public:
QDateTime(const QDate &date, const QTime &time, const QTimeZone &timeZone);
#endif // QT_BOOTSTRAPPED
QDateTime(const QDateTime &other) Q_DECL_NOTHROW;
+ QDateTime(QDateTime &&other) Q_DECL_NOTHROW;
~QDateTime();
#ifdef Q_COMPILER_RVALUE_REFS