summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qvariant_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/kernel/qvariant_p.h')
-rw-r--r--src/corelib/kernel/qvariant_p.h22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/corelib/kernel/qvariant_p.h b/src/corelib/kernel/qvariant_p.h
index bf88def438..487949431c 100644
--- a/src/corelib/kernel/qvariant_p.h
+++ b/src/corelib/kernel/qvariant_p.h
@@ -177,6 +177,26 @@ inline void v_clear(QVariant::Private *d, T* = 0)
}
+template <typename T>
+struct PrimitiveIsNull
+{
+public:
+ static bool isNull(const QVariant::Private *d)
+ {
+ return d->is_null;
+ }
+};
+
+template <>
+struct PrimitiveIsNull<std::nullptr_t>
+{
+public:
+ static bool isNull(const QVariant::Private *)
+ {
+ return true;
+ }
+};
+
template<class Filter>
class QVariantComparator {
template<typename T, bool IsAcceptedType = Filter::template Acceptor<T>::IsAccepted>
@@ -268,7 +288,7 @@ class QVariantIsNull
{
static bool isNull(const QVariant::Private *d)
{
- return d->is_null;
+ return PrimitiveIsNull<T>::isNull(d);
}
};