Update changelog

This commit is contained in:
Victor Zverovich 2021-05-22 20:55:56 -07:00
parent b099a56f9f
commit c04a24399a

View File

@ -9,10 +9,9 @@
#include <fmt/compile.h> #include <fmt/compile.h>
consteval std::array<char, 10> compile_time_itoa(int) { consteval std::array<char, 10> compile_time_itoa(int value) {
using namespace fmt::literals;
auto result = std::array<char, 10>(); auto result = std::array<char, 10>();
fmt::format_to(result.data(), "{}"_cf, 42); fmt::format_to(result.data(), FMT_COMPILE("{}"), value);
return result; return result;
} }
@ -20,12 +19,29 @@
exception of floating-point numbers and pointers. exception of floating-point numbers and pointers.
Thanks `@alexezeder (Alexey Ochapov) <https://github.com/alexezeder>`_. Thanks `@alexezeder (Alexey Ochapov) <https://github.com/alexezeder>`_.
* 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 <fmt/compile.h>
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) <https://github.com/alexezeder>`_.
* Optimized handling of format specifiers during format string * Optimized handling of format specifiers during format string
compilation, including but not limited to hexadecimal formatting compilation, including but not limited to hexadecimal formatting
(`#1944 <https://github.com/fmtlib/fmt/issues/1944>`_). (`#1944 <https://github.com/fmtlib/fmt/issues/1944>`_).
* Made ``std::byte`` formattable with ``fmt::join`` * Made ``std::byte`` and streamable types formattable with ``fmt::join``
(`#1981 <https://github.com/fmtlib/fmt/issues/1981>`_). For example: (`#1981 <https://github.com/fmtlib/fmt/issues/1981>`_,
`#2040 <https://github.com/fmtlib/fmt/issues/2040>`_,
`#2050 <https://github.com/fmtlib/fmt/pull/2050>`_). For example:
.. code:: c++ .. code:: c++
@ -40,8 +56,10 @@
prints "42". prints "42".
* Formatting floating-point numbers no longer produces trailing zeros by Thanks `@kamibo (Camille Bordignon) <https://github.com/kamibo>`_.
default for consistency with Python and ``std::format``. For example:
* 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++ .. code:: c++
@ -72,7 +90,7 @@
pass ``fmt::file::WRONLY | fmt::file::CREATE`` flags to ``fmt::output_file``. pass ``fmt::file::WRONLY | fmt::file::CREATE`` flags to ``fmt::output_file``.
* Fixed handling of enums in ``fmt::to_string`` * Fixed handling of enums in ``fmt::to_string``
(`#2036 <https://github.com/fmtlib/fmt/issues/2036>`_) (`#2036 <https://github.com/fmtlib/fmt/issues/2036>`_)
* Fixed handling of empty format strings during format string compilation * Fixed handling of empty format strings during format string compilation
(`#2042 <https://github.com/fmtlib/fmt/issues/2042>`_): (`#2042 <https://github.com/fmtlib/fmt/issues/2042>`_):
@ -84,10 +102,18 @@
Thanks `@alexezeder (Alexey Ochapov) <https://github.com/alexezeder>`_. Thanks `@alexezeder (Alexey Ochapov) <https://github.com/alexezeder>`_.
* Fixed various warnings and compilation issues * Fixed various warnings and compilation issues
(`#2047 <https://github.com/fmtlib/fmt/issues/2047>`_). (`#2039 <https://github.com/fmtlib/fmt/issues/2039>`_,
`#2047 <https://github.com/fmtlib/fmt/issues/2047>`_,
`#2053 <https://github.com/fmtlib/fmt/pull/2053>`_,
`#2059 <https://github.com/fmtlib/fmt/issues/2059>`_,
`#2065 <https://github.com/fmtlib/fmt/pull/2065>`_,
`#2068 <https://github.com/fmtlib/fmt/pull/2068>`_).
Thanks `@Finkman <https://github.com/Finkman>`_,
`@dkavolis (Daumantas Kavolis) <https://github.com/dkavolis>`_.
* Improved documentation * Improved documentation
(`#2051 <https://github.com/fmtlib/fmt/pull/2051>`_). (`#2051 <https://github.com/fmtlib/fmt/pull/2051>`_,
`#2057 <https://github.com/fmtlib/fmt/issues/2057>`_).
Thanks `@imba-tjd (谭九鼎) <https://github.com/imba-tjd>`_. Thanks `@imba-tjd (谭九鼎) <https://github.com/imba-tjd>`_.
7.1.3 - 2020-11-24 7.1.3 - 2020-11-24