diff options
author | Mikhail Svetkin <mikhail.svetkin@qt.io> | 2018-08-28 16:41:28 +0200 |
---|---|---|
committer | Mikhail Svetkin <mikhail.svetkin@qt.io> | 2018-09-05 14:11:15 +0000 |
commit | 40cd0f35ef0b27b1451caf393a97b8a4ac8cd4b2 (patch) | |
tree | de2890a104f93803f9713e6e0ca9017f0d0110bb /src/corelib/tools/qstring.h | |
parent | dd944136a253ba40def26046729e5020b179692a (diff) |
Remove QConditional in favor of std::conditional/std::is_unsigned
Change-Id: I5e0b9f640eb49aa7f5afdd4f3f15e027659e78ea
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'src/corelib/tools/qstring.h')
-rw-r--r-- | src/corelib/tools/qstring.h | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/corelib/tools/qstring.h b/src/corelib/tools/qstring.h index f18baf7065..77b562ec5b 100644 --- a/src/corelib/tools/qstring.h +++ b/src/corelib/tools/qstring.h @@ -896,10 +896,8 @@ private: template <typename T> static T toIntegral_helper(const QChar *data, int len, bool *ok, int base) { - // ### Qt6: use std::conditional<std::is_unsigned<T>::value, qulonglong, qlonglong>::type - const bool isUnsigned = T(0) < T(-1); - typedef typename QtPrivate::QConditional<isUnsigned, qulonglong, qlonglong>::Type Int64; - typedef typename QtPrivate::QConditional<isUnsigned, uint, int>::Type Int32; + using Int64 = typename std::conditional<std::is_unsigned<T>::value, qulonglong, qlonglong>::type; + using Int32 = typename std::conditional<std::is_unsigned<T>::value, uint, int>::type; // we select the right overload by casting size() to int or uint Int64 val = toIntegral_helper(data, Int32(len), ok, base); |