Fixed static assert in qvariant template magic
CallConstructor<T, /* CanUseInternalSpace = */ false> is called when we need to construct an object that couldn't be fit in qvariantdata, meaning either it is not a POD type (Q_PRIMITIVE_TYPE), or it is simply too large to fit there. Change-Id: Ied122b4a6f600e14312a8d515f5b3e91214a94f1 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
This commit is contained in:
parent
7a597e6c43
commit
e3e234b5eb
@ -327,7 +327,7 @@ class QVariantConstructor
|
||||
{
|
||||
CallConstructor(const QVariantConstructor &tc)
|
||||
{
|
||||
Q_STATIC_ASSERT(QTypeInfo<T>::isComplex);
|
||||
Q_STATIC_ASSERT(QTypeInfo<T>::isComplex || sizeof(T) > sizeof(QVariant::Private::Data));
|
||||
tc.m_x->data.shared = tc.m_copy ? new QVariantPrivateSharedEx<T>(*static_cast<const T*>(tc.m_copy))
|
||||
: new QVariantPrivateSharedEx<T>;
|
||||
tc.m_x->is_shared = true;
|
||||
|
Loading…
Reference in New Issue
Block a user