From 589d37e155f3f6704e32d56d86dd3af164e0dbf7 Mon Sep 17 00:00:00 2001 From: Andrei Golubev Date: Mon, 21 Sep 2020 16:08:35 +0200 Subject: Use Q_RELOCATABLE* instead of Q_MOVABLE* wording in docs Movable in Qt is confusing since C++11. Our code also relies on wording with "relocatable" and "movable" is mostly a backwards-compatibility thing Change-Id: I28f5a61b4482aa1dd26c7b760d78be031d11ef10 Reviewed-by: Sona Kurazyan --- src/corelib/global/qglobal.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index 1c55cb8f9f..4c7a5e0f78 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2020 The Qt Company Ltd. ** Copyright (C) 2017 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** @@ -3984,10 +3984,12 @@ bool qunsetenv(const char *varName) data) type with no constructor or destructor, or else a type where every bit pattern is a valid object and memcpy() creates a valid independent copy of the object. - \li \c Q_MOVABLE_TYPE specifies that \a Type has a constructor + \li \c Q_RELOCATABLE_TYPE specifies that \a Type has a constructor and/or a destructor but can be moved in memory using \c - memcpy(). Note: despite the name, this has nothing to do with move - constructors or C++ move semantics. + memcpy(). + \li \c Q_MOVABLE_TYPE is the same as \c Q_RELOCATABLE_TYPE. Prefer to use + \c Q_RELOCATABLE_TYPE in new code. Note: despite the name, this + has nothing to do with move constructors or C++ move semantics. \li \c Q_COMPLEX_TYPE (the default) specifies that \a Type has constructors and/or a destructor and that it may not be moved in memory. @@ -4008,10 +4010,8 @@ bool qunsetenv(const char *varName) Qt will try to detect the class of a type using std::is_trivial or std::is_trivially_copyable. Use this macro to tune the behavior. - For instance many types would be candidates for Q_MOVABLE_TYPE despite - not being trivially-copyable. For binary compatibility reasons, QList - optimizations are only enabled if there is an explicit - Q_DECLARE_TYPEINFO even for trivially-copyable types. + For instance many types would be candidates for Q_RELOCATABLE_TYPE despite + not being trivially-copyable. */ /*! -- cgit v1.2.3