summaryrefslogtreecommitdiffstats
path: root/src/corelib/global
diff options
context:
space:
mode:
authorAndreas Buhr <andreas.buhr@qt.io>2020-11-17 16:36:02 +0100
committerAndreas Buhr <andreas.buhr@qt.io>2020-11-30 23:11:04 +0100
commitd545fbb61b699802e9ae1a3c19f4c4bef724fbda (patch)
treeed97737767218c020cb14f31d47840e8987d691e /src/corelib/global
parent6c442ddbf584413fa4228aae4cc277887344e20d (diff)
Extend container overview documentation, mention Q_DECLARE_TYPEINFO
The container overview documentation did not mention Q_DECLARE_TYPEINFO and the related optimizations. This patch adds a short paragraph about it. Task-number: QTBUG-86584 Pick-to: 6.0 Change-Id: I5b0b8ce92a47da5f0398cc413fbf3e07b0921e59 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Diffstat (limited to 'src/corelib/global')
-rw-r--r--src/corelib/global/qglobal.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp
index 62ca2ca8a1..bcfc6ada2e 100644
--- a/src/corelib/global/qglobal.cpp
+++ b/src/corelib/global/qglobal.cpp
@@ -3995,12 +3995,19 @@ bool qunsetenv(const char *varName)
pattern still represents a valid object, and memcpy() can be used
to create a valid independent copy of a QUuid object.
- Example of a movable type:
+ Example of a relocatable type:
\snippet code/src_corelib_global_qglobal.cpp 39
- 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.
+ 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 indentify 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.
For instance many types would be candidates for Q_RELOCATABLE_TYPE despite
not being trivially-copyable.
*/