Skip to content

Commit

Permalink
Update changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
vitaut committed May 23, 2021
1 parent b099a56 commit c04a243
Showing 1 changed file with 36 additions and 10 deletions.
46 changes: 36 additions & 10 deletions ChangeLog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,39 @@

#include <fmt/compile.h>

consteval std::array<char, 10> compile_time_itoa(int) {
using namespace fmt::literals;
consteval std::array<char, 10> compile_time_itoa(int value) {
auto result = std::array<char, 10>();
fmt::format_to(result.data(), "{}"_cf, 42);
fmt::format_to(result.data(), FMT_COMPILE("{}"), value);
return result;
}

Most of formatting functionality is available at compile time with a notable
exception of floating-point numbers and pointers.
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
compilation, including but not limited to hexadecimal formatting
(`#1944 <https://github.com/fmtlib/fmt/issues/1944>`_).

* Made ``std::byte`` formattable with ``fmt::join``
(`#1981 <https://github.com/fmtlib/fmt/issues/1981>`_). For example:
* Made ``std::byte`` and streamable types formattable with ``fmt::join``
(`#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++

Expand All @@ -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) <https://github.com/kamibo>`_.

* 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++

Expand Down Expand Up @@ -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 <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
(`#2042 <https://github.com/fmtlib/fmt/issues/2042>`_):
Expand All @@ -84,10 +102,18 @@
Thanks `@alexezeder (Alexey Ochapov) <https://github.com/alexezeder>`_.

* 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
(`#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>`_.

7.1.3 - 2020-11-24
Expand Down

0 comments on commit c04a243

Please sign in to comment.