summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qvariant_p.h
diff options
context:
space:
mode:
authorKai Koehne <kai.koehne@qt.io>2016-08-05 10:12:12 +0200
committerKai Koehne <kai.koehne@qt.io>2016-11-08 15:31:17 +0000
commited7f77071dcca996a8c8147fd66344090666e60c (patch)
tree0f36d33272e9edf80f30f15d1fb4cc7026534267 /src/corelib/kernel/qvariant_p.h
parentb5fa247102c610d8ed4c1d88a7f1ea685b96c91f (diff)
Replace custom type traits with std one's
Remove most type traits from qtypetraits.h, but keep the custom implementation of is_signed/is_unsigned. This gets rid of BSD-3 licensed code from Google in a public header (hugh!). The custom implementations for is_signed/is_unsigned are kept because the implementations in gcc's standard headers do not work as we expect for enums - both is_signed and is_unsigned always returns false there - see also https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59027 [ChangeLog][QtCore][General] Qt now relies on type traits from the C++ standard library. Change-Id: I3f2188b46949f04ca4482a6ac9afd3482103f0e1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/kernel/qvariant_p.h')
-rw-r--r--src/corelib/kernel/qvariant_p.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/corelib/kernel/qvariant_p.h b/src/corelib/kernel/qvariant_p.h
index d01f386032..ec87e20656 100644
--- a/src/corelib/kernel/qvariant_p.h
+++ b/src/corelib/kernel/qvariant_p.h
@@ -66,7 +66,7 @@ struct QVariantIntegrator
{
static const bool CanUseInternalSpace = sizeof(T) <= sizeof(QVariant::Private::Data)
&& ((QTypeInfoQuery<T>::isRelocatable) || Q_IS_ENUM(T));
- typedef QtPrivate::integral_constant<bool, CanUseInternalSpace> CanUseInternalSpace_t;
+ typedef std::integral_constant<bool, CanUseInternalSpace> CanUseInternalSpace_t;
};
Q_STATIC_ASSERT(QVariantIntegrator<double>::CanUseInternalSpace);
Q_STATIC_ASSERT(QVariantIntegrator<long int>::CanUseInternalSpace);
@@ -118,28 +118,28 @@ private:
};
template <class T>
-inline void v_construct_helper(QVariant::Private *x, const T &t, QtPrivate::true_type)
+inline void v_construct_helper(QVariant::Private *x, const T &t, std::true_type)
{
new (&x->data) T(t);
x->is_shared = false;
}
template <class T>
-inline void v_construct_helper(QVariant::Private *x, const T &t, QtPrivate::false_type)
+inline void v_construct_helper(QVariant::Private *x, const T &t, std::false_type)
{
x->data.shared = new QVariantPrivateSharedEx<T>(t);
x->is_shared = true;
}
template <class T>
-inline void v_construct_helper(QVariant::Private *x, QtPrivate::true_type)
+inline void v_construct_helper(QVariant::Private *x, std::true_type)
{
new (&x->data) T();
x->is_shared = false;
}
template <class T>
-inline void v_construct_helper(QVariant::Private *x, QtPrivate::false_type)
+inline void v_construct_helper(QVariant::Private *x, std::false_type)
{
x->data.shared = new QVariantPrivateSharedEx<T>;
x->is_shared = true;