QTypeInfo: move helpers in QtPrivate namespace
qIsRelocatable and qIsValueInitializationBitwiseZero are not public API, hide them away. Pick-to: 6.5 6.5.0 Change-Id: Ib4eeaab46d01759098e96091b700e9a28fd50962 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>bb10
parent
0bcb0062ba
commit
0ca803a5d3
|
|
@ -19,6 +19,8 @@ class QDebug;
|
|||
QTypeInfo - type trait functionality
|
||||
*/
|
||||
|
||||
namespace QtPrivate {
|
||||
|
||||
template <typename T>
|
||||
inline constexpr bool qIsRelocatable = std::is_trivially_copyable_v<T> && std::is_trivially_destructible_v<T>;
|
||||
|
||||
|
|
@ -32,6 +34,8 @@ template <typename T>
|
|||
inline constexpr bool qIsValueInitializationBitwiseZero =
|
||||
std::is_scalar_v<T> && !std::is_member_object_pointer_v<T>;
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
The catch-all template.
|
||||
*/
|
||||
|
|
@ -44,8 +48,8 @@ public:
|
|||
isPointer [[deprecated("Use std::is_pointer instead")]] = std::is_pointer_v<T>,
|
||||
isIntegral [[deprecated("Use std::is_integral instead")]] = std::is_integral_v<T>,
|
||||
isComplex = !std::is_trivial_v<T>,
|
||||
isRelocatable = qIsRelocatable<T>,
|
||||
isValueInitializationBitwiseZero = qIsValueInitializationBitwiseZero<T>,
|
||||
isRelocatable = QtPrivate::qIsRelocatable<T>,
|
||||
isValueInitializationBitwiseZero = QtPrivate::qIsValueInitializationBitwiseZero<T>,
|
||||
};
|
||||
};
|
||||
|
||||
|
|
@ -148,10 +152,10 @@ class QTypeInfo<TYPE > \
|
|||
public: \
|
||||
enum { \
|
||||
isComplex = (((FLAGS) & Q_PRIMITIVE_TYPE) == 0) && !std::is_trivial_v<TYPE>, \
|
||||
isRelocatable = !isComplex || ((FLAGS) & Q_RELOCATABLE_TYPE) || qIsRelocatable<TYPE>, \
|
||||
isRelocatable = !isComplex || ((FLAGS) & Q_RELOCATABLE_TYPE) || QtPrivate::qIsRelocatable<TYPE>, \
|
||||
isPointer [[deprecated("Use std::is_pointer instead")]] = std::is_pointer_v< TYPE >, \
|
||||
isIntegral [[deprecated("Use std::is_integral instead")]] = std::is_integral< TYPE >::value, \
|
||||
isValueInitializationBitwiseZero = qIsValueInitializationBitwiseZero<TYPE>, \
|
||||
isValueInitializationBitwiseZero = QtPrivate::qIsValueInitializationBitwiseZero<TYPE>, \
|
||||
}; \
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ class QVariant;
|
|||
template<typename T>
|
||||
inline T qvariant_cast(const QVariant &);
|
||||
|
||||
template<> constexpr inline bool qIsRelocatable<QVariant> = true;
|
||||
template<> constexpr inline bool QtPrivate::qIsRelocatable<QVariant> = true;
|
||||
class Q_CORE_EXPORT QVariant
|
||||
{
|
||||
struct CborValueStandIn { qint64 n; void *c; int t; };
|
||||
|
|
|
|||
Loading…
Reference in New Issue