summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@woboq.com>2012-04-25 11:09:48 +0200
committerQt by Nokia <qt-info@nokia.com>2012-06-20 03:17:55 +0200
commit958aaf377069368ce409db3f09a6ac3e38af7de2 (patch)
treebaf9c866d5946bbabefcf6149c226a9ad023b49d /src
parente4505acd12435f1b7d0dabe79823ccb7e26011e9 (diff)
Add qMove macro to support std::move
Change-Id: I373e07f479c11b172dab35ed7e5b62724aa50a1a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src')
-rw-r--r--src/corelib/global/qcompilerdetection.h6
-rw-r--r--src/corelib/global/qglobal.cpp8
2 files changed, 14 insertions, 0 deletions
diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h
index 8621d8b400..68c8f73fe3 100644
--- a/src/corelib/global/qcompilerdetection.h
+++ b/src/corelib/global/qcompilerdetection.h
@@ -779,4 +779,10 @@
# endif
#endif
+#ifdef Q_COMPILER_RVALUE_REFS
+#define qMove(x) std::move(x)
+#else
+#define qMove(x) (x)
+#endif
+
#endif // QCOMPILERDETECTION_H
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp
index 1bc02e0a70..900859141d 100644
--- a/src/corelib/global/qglobal.cpp
+++ b/src/corelib/global/qglobal.cpp
@@ -3006,4 +3006,12 @@ bool QInternal::activateCallbacks(Callback cb, void **parameters)
{Debugging Techniques}
*/
+/*!
+ \macro qMove(x)
+ \relates <QtGlobal>
+
+ It expands to "std::move" if your compiler supports that C++11 function, or to nothing
+ otherwise.
+*/
+
QT_END_NAMESPACE