Member functions of mixins should be defined out of line

Per [temp.explicit]/10, explicit instantiation declarations
do not affect inline member functions
This commit is contained in:
Mat Sutcliffe
2021-10-07 23:57:57 +01:00
parent 5a1f3e8dd1
commit 9fdeb466fa
12 changed files with 679 additions and 387 deletions

View File

@@ -50,8 +50,7 @@ namespace BlackMisc
void registerMetaValueType()
{
if (QMetaType::hasRegisteredConverterFunction<T, Private::IValueObjectMetaInfo *>()) { return; }
auto converter = [](const T &) { static Private::CValueObjectMetaInfo<T> info; return &info; };
bool ok = QMetaType::registerConverter<T, Private::IValueObjectMetaInfo *>(converter);
bool ok = QMetaType::registerConverter<T, Private::IValueObjectMetaInfo *>(Private::CValueObjectMetaInfo<T>::instance);
Q_ASSERT(ok);
Q_UNUSED(ok);
}