[Clang][Windows] Remove workarounds

This commit is contained in:
Mat Sutcliffe
2021-10-05 15:47:44 +01:00
parent fb43405277
commit 916448ef6a
19 changed files with 89 additions and 229 deletions

View File

@@ -13,7 +13,7 @@
#include "blackmisc/inheritancetraits.h"
#include "blackmisc/propertyindexref.h"
#include "blackmisc/variantprivate.h"
#include "blackmisc/variant.h"
#include <QMetaType>
#include <QtGlobal>
#include <QString>
@@ -79,23 +79,6 @@ namespace BlackMisc
// *INDENT-ON*
} // Mixin
/*!
* This registers the value type T with the BlackMisc meta type system,
* making it available for use with the extended feature set of BlackMisc::CVariant.
*
* The implementation (ab)uses the QMetaType converter function registration mechanism
* to store a type-erased representation of the set of operations supported by T.
*/
template <typename T>
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);
Q_ASSERT(ok);
Q_UNUSED(ok);
}
} // namespace
#endif