diff options
Diffstat (limited to 'src/corelib/global/qtypeinfo.qdoc')
-rw-r--r-- | src/corelib/global/qtypeinfo.qdoc | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/src/corelib/global/qtypeinfo.qdoc b/src/corelib/global/qtypeinfo.qdoc index 78d9d423cd..75a92da197 100644 --- a/src/corelib/global/qtypeinfo.qdoc +++ b/src/corelib/global/qtypeinfo.qdoc @@ -13,13 +13,13 @@ \a Flags can be one of the following: \list - \li \c Q_PRIMITIVE_TYPE specifies that \a Type can be created by - zero-initializing its storage, requires no operation to be properly - destroyed, and for which memcpy()ing creates a valid independent - copy of the object. + \li \c Q_PRIMITIVE_TYPE specifies that \a Type requires no + operation to be performed in order to be properly destroyed, + and that it is possible to use memcpy() in order to create a + valid independent copy of an object. \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(). + and/or a destructor, but it can still be \e{relocated} in memory + by using \c 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. @@ -41,15 +41,8 @@ \snippet code/src_corelib_global_qglobal.cpp 39 - Qt will try to detect the class of a type using - \l {https://en.cppreference.com/w/cpp/types/is_trivial} {std::is_trivial_v<T>} - to identify primitive - types and it will require both - \l {https://en.cppreference.com/w/cpp/types/is_trivially_copyable} {std::is_trivially_copyable_v<T>} - and - \l {https://en.cppreference.com/w/cpp/types/is_destructible} {std::is_trivially_destructible_v<T>} - to identify relocatable types. - Use this macro to tune the behavior. + Qt will try to detect the class of a type using standard C++ type traits; + use this macro to tune the behavior. For instance many types would be candidates for Q_RELOCATABLE_TYPE despite not being trivially-copyable. */ |