QMetaType: Do copy constuctible check at compile time
Change-Id: I2f6a9bbaa0153fa33fc6a0b68bcedfbe3b9b1a7c Reviewed-by: Lars Knoll <lars.knoll@qt.io>bb10
parent
98ca319819
commit
fe275c75ae
|
|
@ -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));
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue