summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorJędrzej Nowacki <jedrzej.nowacki@digia.com>2014-03-06 14:54:19 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-04-23 21:40:36 +0200
commit33fae8b147eccec9b97629fe84a0b0753d446cf3 (patch)
tree4fa781f4f3510d41f8eea6a23cad13efa723b042 /src/corelib
parent969da85c2b6523432af1728cbb5ee311652decb0 (diff)
Build fix for auto-registration of Container<void*>
IteratorOwner pointer specialization was failing for void* because of an invalid function overload. Change-Id: I80355ddd2b871c1fa2fa5bf5a4ed8bc7768fc3c9 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/kernel/qmetatype.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/corelib/kernel/qmetatype.h b/src/corelib/kernel/qmetatype.h
index ad853d5b03..3c9cc9ee28 100644
--- a/src/corelib/kernel/qmetatype.h
+++ b/src/corelib/kernel/qmetatype.h
@@ -821,7 +821,14 @@ struct IteratorOwner
template<typename value_type>
struct IteratorOwner<const value_type*>
{
- static void assign(void **ptr, const value_type *iterator )
+private:
+ // We need to disable typed overloads of assign() and getData() if the value_type
+ // is void* to avoid overloads conflicts. We do it by injecting unaccessible Dummy
+ // type as part of the overload signature.
+ struct Dummy {};
+ typedef typename QtPrivate::if_<QtPrivate::is_same<value_type, void*>::value, Dummy, value_type>::type value_type_OR_Dummy;
+public:
+ static void assign(void **ptr, const value_type_OR_Dummy *iterator )
{
*ptr = const_cast<value_type*>(iterator);
}
@@ -846,7 +853,7 @@ struct IteratorOwner<const value_type*>
return *iterator;
}
- static const void *getData(const value_type *it)
+ static const void *getData(const value_type_OR_Dummy *it)
{
return it;
}