CTF: Use static with operator

Also fix coding style in the operator.

Pick-to: 6.5
Change-Id: Ia8f85a7bb7aa2d6f55923c80f72b734fc8dbd693
Reviewed-by: Hatem ElKharashy <hatem.elkharashy@qt.io>
Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io>
Reviewed-by: Antti Määttä <antti.maatta@qt.io>
This commit is contained in:
Antti Määttä 2023-06-01 10:50:12 +03:00
parent d214c56e43
commit d67abb9de1

View File

@ -31,10 +31,10 @@ static const char traceMetadataTemplate[] =
static const size_t traceMetadataSize = sizeof(traceMetadataTemplate);
template <typename T>
QByteArray &operator<<(QByteArray &arr, T val)
static QByteArray &operator<<(QByteArray &arr, T val)
{
static_assert(std::is_arithmetic_v<T>);
arr.append((char *)&val, sizeof(val));
arr.append(reinterpret_cast<char *>(&val), sizeof(val));
return arr;
}