diff --git a/src/corelib/kernel/qmetatype.h b/src/corelib/kernel/qmetatype.h index 986d22b5a6..745487627e 100644 --- a/src/corelib/kernel/qmetatype.h +++ b/src/corelib/kernel/qmetatype.h @@ -808,6 +808,11 @@ struct IteratorOwner { return &*it; } + + static bool equal(void * const *it, void * const *other) + { + return *static_cast(*it) == *static_cast(*other); + } }; template struct IteratorOwner @@ -841,6 +846,11 @@ struct IteratorOwner { return it; } + + static bool equal(void * const *it, void * const *other) + { + return static_cast(*it) == static_cast(*other); + } }; enum IteratorCapability @@ -942,7 +952,7 @@ public: template static bool equalIterImpl(void * const *iterator, void * const *other) - { return *static_cast(*iterator) == *static_cast(*other); } + { return IteratorOwner::equal(iterator, other); } template static VariantData getImpl(void * const *iterator, int metaTypeId, uint flags) @@ -1126,7 +1136,7 @@ public: template static bool equalIterImpl(void * const *iterator, void * const *other) - { return *static_cast(*iterator) == *static_cast(*other); } + { return IteratorOwner::equal(iterator, other); } template static void copyIterImpl(void **dest, void * const * src)