mirror of
https://github.com/fmtlib/fmt.git
synced 2025-01-29 12:32:38 +00:00
Update changelog
This commit is contained in:
parent
c10e3f7f4f
commit
62c72059d9
@ -1,15 +1,17 @@
|
|||||||
7.1.0 - TBD
|
7.1.0 - TBD
|
||||||
-----------
|
-----------
|
||||||
|
|
||||||
* Switched from Grisu3 to `Dragonbox <https://github.com/jk-jeon/dragonbox>`_
|
* Switched from `Grisu3
|
||||||
for the default floating-point formatting which gives the shortest decimal
|
<https://www.cs.tufts.edu/~nr/cs257/archive/florian-loitsch/printf.pdf>`_
|
||||||
representation with round-trip and correct rounding guarantees
|
to `Dragonbox <https://github.com/jk-jeon/dragonbox>`_ for the default
|
||||||
|
floating-point formatting which gives the shortest decimal representation
|
||||||
|
with round-trip guarantee and correct rounding
|
||||||
(`#1882 <https://github.com/fmtlib/fmt/pull/1882>`_,
|
(`#1882 <https://github.com/fmtlib/fmt/pull/1882>`_,
|
||||||
`#1887 <https://github.com/fmtlib/fmt/pull/1887>`_,
|
`#1887 <https://github.com/fmtlib/fmt/pull/1887>`_,
|
||||||
`#1894 <https://github.com/fmtlib/fmt/pull/1894>`_). This makes {fmt} up to
|
`#1894 <https://github.com/fmtlib/fmt/pull/1894>`_). This makes {fmt} up to
|
||||||
20-30x faster than common implementations of ``std::ostringstream`` and
|
20-30x faster than common implementations of ``std::ostringstream`` and
|
||||||
``sprintf`` on `dtoa-benchmark <https://github.com/fmtlib/dtoa-benchmark>`_
|
``sprintf`` on `dtoa-benchmark <https://github.com/fmtlib/dtoa-benchmark>`_
|
||||||
and faster than double-conversion and ryu:
|
and faster than double-conversion and Ryū:
|
||||||
|
|
||||||
.. image:: https://user-images.githubusercontent.com/576385/
|
.. image:: https://user-images.githubusercontent.com/576385/
|
||||||
95684665-11719600-0ba8-11eb-8e5b-972ff4e49428.png
|
95684665-11719600-0ba8-11eb-8e5b-972ff4e49428.png
|
||||||
@ -20,8 +22,9 @@
|
|||||||
Thanks `@jk-jeon (Junekey Jeon) <https://github.com/jk-jeon>`_.
|
Thanks `@jk-jeon (Junekey Jeon) <https://github.com/jk-jeon>`_.
|
||||||
|
|
||||||
* Added an experimental unsynchronized file output API which, together with
|
* Added an experimental unsynchronized file output API which, together with
|
||||||
the format string compilation, can give `5-9 times speed up compared to
|
`format string compilation <https://fmt.dev/latest/api.html#compile-api>`_,
|
||||||
fprintf <https://www.zverovich.net/2020/08/04/optimal-file-buffer-size.html>`_
|
can give `5-9 times speed up compared to fprintf
|
||||||
|
<https://www.zverovich.net/2020/08/04/optimal-file-buffer-size.html>`_
|
||||||
on common platforms (`godbolt <https://godbolt.org/z/nsTcG8>`__):
|
on common platforms (`godbolt <https://godbolt.org/z/nsTcG8>`__):
|
||||||
|
|
||||||
.. code:: c++
|
.. code:: c++
|
||||||
@ -127,12 +130,12 @@
|
|||||||
fmt/core.h:1438:3: error: static_assert failed due to requirement
|
fmt/core.h:1438:3: error: static_assert failed due to requirement
|
||||||
'fmt::v7::formattable<how_about_no>()' "Cannot format an argument.
|
'fmt::v7::formattable<how_about_no>()' "Cannot format an argument.
|
||||||
To make type T formattable provide a formatter<T> specialization:
|
To make type T formattable provide a formatter<T> specialization:
|
||||||
https://fmt.dev/dev/api.html#udt"
|
https://fmt.dev/latest/api.html#udt"
|
||||||
...
|
...
|
||||||
|
|
||||||
* Added the `make_args_checked <https://fmt.dev/7.1.0/api.html#argument-lists>`_
|
* Added the `make_args_checked <https://fmt.dev/7.1.0/api.html#argument-lists>`_
|
||||||
function template that allows you to write formatting functions with
|
function template that allows you to write formatting functions with
|
||||||
compile-time format string checks
|
compile-time format string checks and avoid binary code bloat
|
||||||
(`godbolt <https://godbolt.org/z/PEf9qr>`__):
|
(`godbolt <https://godbolt.org/z/PEf9qr>`__):
|
||||||
|
|
||||||
.. code:: c++
|
.. code:: c++
|
||||||
@ -166,34 +169,36 @@
|
|||||||
fmt::print("{:.500}\n", 4.9406564584124654E-324);
|
fmt::print("{:.500}\n", 4.9406564584124654E-324);
|
||||||
}
|
}
|
||||||
|
|
||||||
prints ``4.9406564584124654417656879286822137236505980261432476442558568250067550727020875186529983636163599237979656469544571773092665671035593979639877479601078187812630071319031140452784581716784898210368871863605699873072305000638740915356498438731247339727316961514003171538539807412623856559117102665855668676818703956031062493194527159149245532930545654440112748012970999954193198940908041656332452475714786901472678015935523861155013480352649347201937902681071074917033322268447533357208324319360923829e-324``.
|
prints
|
||||||
|
|
||||||
|
``4.9406564584124654417656879286822137236505980261432476442558568250067550727020875186529983636163599237979656469544571773092665671035593979639877479601078187812630071319031140452784581716784898210368871863605699873072305000638740915356498438731247339727316961514003171538539807412623856559117102665855668676818703956031062493194527159149245532930545654440112748012970999954193198940908041656332452475714786901472678015935523861155013480352649347201937902681071074917033322268447533357208324319360923829e-324``.
|
||||||
|
|
||||||
* Made ``format_to_n`` and ``formatted_size`` part of the `core API
|
* Made ``format_to_n`` and ``formatted_size`` part of the `core API
|
||||||
<https://fmt.dev/latest/api.html#core-api>`__
|
<https://fmt.dev/latest/api.html#core-api>`__
|
||||||
(`godbolt <https://godbolt.org/z/33Pzo3>`__):
|
(`godbolt <https://godbolt.org/z/sPjY1K>`__):
|
||||||
|
|
||||||
.. code:: c++
|
.. code:: c++
|
||||||
|
|
||||||
#include <fmt/core.h>
|
#include <fmt/core.h>
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
char buf[10];
|
char buffer[10];
|
||||||
auto end = fmt::format_to_n(buf, sizeof(buf), "{}", 42);
|
auto result = fmt::format_to_n(buffer, sizeof(buffer), "{}", 42);
|
||||||
}
|
}
|
||||||
|
|
||||||
* Added ``fmt::format_to_n`` overload with format string compilation
|
* Added ``fmt::format_to_n`` overload with format string compilation
|
||||||
(`#1764 <https://github.com/fmtlib/fmt/issues/1764>`_,
|
(`#1764 <https://github.com/fmtlib/fmt/issues/1764>`_,
|
||||||
`#1767 <https://github.com/fmtlib/fmt/pull/1767>`_,
|
`#1767 <https://github.com/fmtlib/fmt/pull/1767>`_,
|
||||||
`#1869 <https://github.com/fmtlib/fmt/pull/1869>`_). For example
|
`#1869 <https://github.com/fmtlib/fmt/pull/1869>`_). For example
|
||||||
(`godbolt <https://godbolt.org/z/xesWh7>`__):
|
(`godbolt <https://godbolt.org/z/93h86q>`__):
|
||||||
|
|
||||||
.. code:: c++
|
.. code:: c++
|
||||||
|
|
||||||
#include <fmt/compile.h>
|
#include <fmt/compile.h>
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
char buf[8];
|
char buffer[8];
|
||||||
fmt::format_to_n(buf, sizeof(buf), FMT_COMPILE("{}"), 42);
|
fmt::format_to_n(buffer, sizeof(buffer), FMT_COMPILE("{}"), 42);
|
||||||
}
|
}
|
||||||
|
|
||||||
Thanks `@Kurkin (Dmitry Kurkin) <https://github.com/Kurkin>`_,
|
Thanks `@Kurkin (Dmitry Kurkin) <https://github.com/Kurkin>`_,
|
||||||
@ -218,7 +223,7 @@
|
|||||||
|
|
||||||
Thanks `@Naios (Denis Blank) <https://github.com/Naios>`_.
|
Thanks `@Naios (Denis Blank) <https://github.com/Naios>`_.
|
||||||
|
|
||||||
* Made `#` emit trailing zeros
|
* Made the `#` specifier emit trailing zeros in addition to the decimal point
|
||||||
(`#1797 <https://github.com/fmtlib/fmt/issues/1797>`_). For example
|
(`#1797 <https://github.com/fmtlib/fmt/issues/1797>`_). For example
|
||||||
(`godbolt <https://godbolt.org/z/bhdcW9>`__):
|
(`godbolt <https://godbolt.org/z/bhdcW9>`__):
|
||||||
|
|
||||||
@ -256,7 +261,7 @@
|
|||||||
Thanks `@t-wiser <https://github.com/t-wiser>`_.
|
Thanks `@t-wiser <https://github.com/t-wiser>`_.
|
||||||
|
|
||||||
* Fixed handling of types that have both an implicit conversion operator and
|
* Fixed handling of types that have both an implicit conversion operator and
|
||||||
an overloaded `ostream` insertion operator
|
an overloaded ``ostream`` insertion operator
|
||||||
(`#1766 <https://github.com/fmtlib/fmt/issues/1766>`_).
|
(`#1766 <https://github.com/fmtlib/fmt/issues/1766>`_).
|
||||||
|
|
||||||
* Fixed a slicing issue in an internal iterator type
|
* Fixed a slicing issue in an internal iterator type
|
||||||
@ -288,7 +293,8 @@
|
|||||||
`#1792 <https://github.com/fmtlib/fmt/pull/1792>`_,
|
`#1792 <https://github.com/fmtlib/fmt/pull/1792>`_,
|
||||||
`#1838 <https://github.com/fmtlib/fmt/pull/1838>`_,
|
`#1838 <https://github.com/fmtlib/fmt/pull/1838>`_,
|
||||||
`#1888 <https://github.com/fmtlib/fmt/pull/1888>`_,
|
`#1888 <https://github.com/fmtlib/fmt/pull/1888>`_,
|
||||||
`#1918 <https://github.com/fmtlib/fmt/pull/1918>`_).
|
`#1918 <https://github.com/fmtlib/fmt/pull/1918>`_,
|
||||||
|
`#1939 <https://github.com/fmtlib/fmt/pull/1939>`_).
|
||||||
Thanks `@leolchat (Léonard Gérard) <https://github.com/leolchat>`_,
|
Thanks `@leolchat (Léonard Gérard) <https://github.com/leolchat>`_,
|
||||||
`@pepsiman (Malcolm Parsons) <https://github.com/pepsiman>`_,
|
`@pepsiman (Malcolm Parsons) <https://github.com/pepsiman>`_,
|
||||||
`@Klaim (Joël Lamotte) <https://github.com/Klaim>`_,
|
`@Klaim (Joël Lamotte) <https://github.com/Klaim>`_,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user