From c04a24399a95d5d990e27d740c447d6aa0695ccb Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Sat, 22 May 2021 20:55:56 -0700 Subject: [PATCH] Update changelog --- ChangeLog.rst | 46 ++++++++++++++++++++++++++++++++++++---------- 1 file changed, 36 insertions(+), 10 deletions(-) diff --git a/ChangeLog.rst b/ChangeLog.rst index 15ca102a..0dc8a79e 100644 --- a/ChangeLog.rst +++ b/ChangeLog.rst @@ -9,10 +9,9 @@ #include - consteval std::array compile_time_itoa(int) { - using namespace fmt::literals; + consteval std::array compile_time_itoa(int value) { auto result = std::array(); - fmt::format_to(result.data(), "{}"_cf, 42); + fmt::format_to(result.data(), FMT_COMPILE("{}"), value); return result; } @@ -20,12 +19,29 @@ exception of floating-point numbers and pointers. Thanks `@alexezeder (Alexey Ochapov) `_. +* Added the ``_cf`` user-defined literal to represent a compiled format string. + It can be used instead of the ``FMT_COMPILE`` macro: + + .. code:: c++ + + #include + + using namespace fmt::literals; + auto s = fmt::format(FMT_COMPILE("{}"), 42); // πŸ™ not modern + auto s = fmt::format("{}"_cf, 42); // πŸ™‚ modern as hell + + It requires compiler support for class types in non-type template parameters + (a C++20 feature) which is available in GCC 9.3+. + Thanks `@alexezeder (Alexey Ochapov) `_. + * Optimized handling of format specifiers during format string compilation, including but not limited to hexadecimal formatting (`#1944 `_). -* Made ``std::byte`` formattable with ``fmt::join`` - (`#1981 `_). For example: +* Made ``std::byte`` and streamable types formattable with ``fmt::join`` + (`#1981 `_, + `#2040 `_, + `#2050 `_). For example: .. code:: c++ @@ -40,8 +56,10 @@ prints "42". -* Formatting floating-point numbers no longer produces trailing zeros by - default for consistency with Python and ``std::format``. For example: + Thanks `@kamibo (Camille Bordignon) `_. + +* Formatting floating-point numbers no longer produces trailing zeros by default + for consistency with Python's ``str.format`` and ``std::format``. For example: .. code:: c++ @@ -72,7 +90,7 @@ pass ``fmt::file::WRONLY | fmt::file::CREATE`` flags to ``fmt::output_file``. * Fixed handling of enums in ``fmt::to_string`` -(`#2036 `_) + (`#2036 `_) * Fixed handling of empty format strings during format string compilation (`#2042 `_): @@ -84,10 +102,18 @@ Thanks `@alexezeder (Alexey Ochapov) `_. * Fixed various warnings and compilation issues - (`#2047 `_). + (`#2039 `_, + `#2047 `_, + `#2053 `_, + `#2059 `_, + `#2065 `_, + `#2068 `_). + Thanks `@Finkman `_, + `@dkavolis (Daumantas Kavolis) `_. * Improved documentation - (`#2051 `_). + (`#2051 `_, + `#2057 `_). Thanks `@imba-tjd (谭九鼎) `_. 7.1.3 - 2020-11-24