Ivan Solovev ffac33964d Add std::format support for qfloat16
The qfloat16 formatter is based of the std::formatter<float>. It is
added in a separate header file qfloat16format.h, so that the users
could include it only when they really need.

After the C++20 standard was released, it had one important addition
that requires the format string to be parsed at compile-time.
This feature is covered by __cpp_lib_format == 202106L.
The older implementations have slightly different signatures of
std::formatter::format() and std::formatter::parse() methods.
To avoid ugly macros, Qt only supports std::format if the compilers
implement __cpp_lib_format >= 202106L.

This commit also defines QT_SUPPORTS_STD_FORMAT macro to avoid
constant repetition of

  if (defined(__cpp_lib_format) && (__cpp_lib_format >= 202106L))

checks.

[ChangeLog][QtCore][qfloat16] Added std::format support for qfloat16.
The supported formatting options are similar to those of std::formatter
for float.

Fixes: QTBUG-104654
Change-Id: I3a0b077a55fbb46573de8b7bcd288b4ef9541953
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-06-05 16:39:44 +02:00
..
2024-06-05 09:08:49 +03:00
2024-06-05 09:08:49 +03:00