QByteArrayView: port IsCompatibleByteTypeHelper from is_same-chain to specialization

Less templates to instantiate, so faster compilation.

Pick-to: 6.5 6.2
Change-Id: I0552e496895db2710f33b8fd4b555cfa5c2d8157
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 327e8a904cb8e6665b7e42ae35cdcfd2afc84409)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Marc Mutz 2024-10-31 11:37:02 +01:00 committed by Qt Cherry-pick Bot
parent 44bf5566cb
commit ced68767da

View File

@ -18,12 +18,11 @@ QT_BEGIN_NAMESPACE
namespace QtPrivate {
template <typename Byte>
struct IsCompatibleByteTypeHelper
: std::integral_constant<bool,
std::is_same_v<Byte, char> ||
std::is_same_v<Byte, uchar> ||
std::is_same_v<Byte, signed char> ||
std::is_same_v<Byte, std::byte>> {};
struct IsCompatibleByteTypeHelper : std::false_type {};
template <> struct IsCompatibleByteTypeHelper<char> : std::true_type {};
template <> struct IsCompatibleByteTypeHelper<signed char> : std::true_type {};
template <> struct IsCompatibleByteTypeHelper<unsigned char> : std::true_type {};
template <> struct IsCompatibleByteTypeHelper<std::byte> : std::true_type {};
template <typename Byte>
struct IsCompatibleByteType