QTypeInfo: add some code comments regarding a redundant check

Change-Id: Ic92f44c8df63bd71f313b672125481d710dc8c66
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
bb10
Giuseppe D'Angelo 2024-03-25 21:42:36 +01:00
parent 4565f97a5c
commit 3ac259f4cc
1 changed files with 7 additions and 0 deletions

View File

@ -23,6 +23,13 @@ class QDebug;
namespace QtPrivate {
// A trivially copyable class must also have a trivial, non-deleted
// destructor [class.prop/1.3], CWG1734. Some implementations don't
// check for a trivial destructor, because of backwards compatibility
// with C++98's definition of trivial copyability.
// Since trivial copiability has implications for the ABI, implementations
// can't "just fix" their traits. So, although formally redundant, we
// explicitly check for trivial destruction here.
template <typename T>
inline constexpr bool qIsRelocatable = std::is_trivially_copyable_v<T> && std::is_trivially_destructible_v<T>;