Skip to content

Commit

Permalink
QByteArrayView: port IsCompatibleByteTypeHelper from is_same-chain to…
Browse files Browse the repository at this point in the history
… 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 327e8a9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
  • Loading branch information
marcmutz authored and Qt Cherry-pick Bot committed Nov 2, 2024
1 parent 44bf556 commit ced6876
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/corelib/text/qbytearrayview.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ced6876

Please sign in to comment.