qfloat16: remove IsIntegral work-around

We now assume that is_integral works for qint128 if QT_SUPPORTS_INT128
is defined, so we no longer need to roll our own version of
std::is_integral.

Amends 0d85d0a72fd0136bd89e201d0cc1bf7fac2c24c8 (which is in 6.7, but
we're only guaranteeing that std::is_integral works for qint128 since
6.8, so not picking all the way).

Task-number: QTBUG-119901
Task-number: QTBUG-117637
Change-Id: I0651f1f17c1abfe4dc2b2d08ae4304fc8dcae092
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit da580a12b10f33fcff5783ca595d1c53b5b8b7de)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Marc Mutz 2024-08-07 11:16:20 +02:00 committed by Qt Cherry-pick Bot
parent feb43b779a
commit 4cb06919aa

View File

@ -53,18 +53,8 @@ class qfloat16
constexpr inline explicit Wrap(int value) : b16(quint16(value)) {}
};
#ifdef QT_SUPPORTS_INT128
template <typename T>
using IsIntegral = std::disjunction<std::is_integral<T>,
std::is_same<std::remove_const_t<T>, qint128>,
std::is_same<std::remove_const_t<T>, quint128>>;
#else
template <typename T>
using IsIntegral = std::is_integral<T>;
#endif
template <typename T>
using if_type_is_integral = std::enable_if_t<IsIntegral<std::remove_reference_t<T>>::value,
bool>;
using if_type_is_integral = std::enable_if_t<std::is_integral_v<std::remove_reference_t<T>>, bool>;
public:
using NativeType = QtPrivate::NativeFloat16Type;