QMetaType: Do copy constuctible check at compile time

Change-Id: I2f6a9bbaa0153fa33fc6a0b68bcedfbe3b9b1a7c
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
bb10
Fabian Kosmale 2020-03-19 11:18:54 +01:00
parent 98ca319819
commit fe275c75ae
1 changed files with 1 additions and 1 deletions

View File

@ -2701,7 +2701,7 @@ QMetaTypeInterface QMetaTypeForType<T>::metaType = {
}
}),
/*.copyCtr=*/ QT_METATYPE_CONSTEXPRLAMDA( -> QMetaTypeInterface::CopyCtrFn {
if (std::is_copy_constructible_v<T>) {
if constexpr (std::is_copy_constructible_v<T>) {
return [](const QMetaTypeInterface *, void *addr, const void *other) {
new (addr) T(*reinterpret_cast<const T *>(other));
};