qfloat16format.h: fix compilation

You can't specialize a class using a qualified name as class-name.
Open and close namespace std instead.

The std:: qualification on the base class is ok, so leave it. Prevents
accidental picking up of a non-std formatting struct.

Amends ffac33964d51971a1c1f61308b6f0a60a4133296.

Pick-to: 6.8
Task-number: QTBUG-104654
Task-number: QTBUG-126385
Change-Id: I92e1b02b0e8b8676c5750c8f9621ae262c53b946
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
This commit is contained in:
Marc Mutz 2024-06-18 17:06:03 +02:00
parent 58d40c69c4
commit 334d4c7b69

View File

@ -45,8 +45,9 @@ using QFloat16FormatterBaseType =
QT_END_NAMESPACE
namespace std {
template <typename CharT>
struct std::formatter<QT_PREPEND_NAMESPACE(qfloat16), CharT>
struct formatter<QT_PREPEND_NAMESPACE(qfloat16), CharT>
: std::formatter<QT_PREPEND_NAMESPACE(QtPrivate::QFloat16FormatterBaseType<CharT>), CharT>
{
template <typename FormatContext>
@ -56,6 +57,7 @@ struct std::formatter<QT_PREPEND_NAMESPACE(qfloat16), CharT>
return std::formatter<FloatType, CharT>::format(FloatType(val), ctx);
}
};
} // namespace std
#endif // QT_SUPPORTS_STD_FORMAT