Opened 2 years ago
Closed 2 years ago
#20028 closed enhancement (fixed)
fmt-11.0.0
| Reported by: | Bruce Dubbs | Owned by: | Bruce Dubbs |
|---|---|---|---|
| Priority: | normal | Milestone: | 12.2 |
| Component: | BOOK | Version: | git |
| Severity: | medium | Keywords: | |
| Cc: |
Description
New major version.
Change History (3)
comment:1 by , 2 years ago
| Owner: | changed from to |
|---|---|
| Status: | new → assigned |
comment:2 by , 2 years ago
comment:3 by , 2 years ago
| Resolution: | → fixed |
|---|---|
| Status: | assigned → closed |
Fixed at commits
40e6b6cbde Update to fmt-11.0.0. a649d19576 Update to libqalculate-5.2.0. 0c075aa0c8 Update to unix-tree-2.1.2. 11196d674e Update to p11-kit-0.25.4.
Note:
See TracTickets
for help on using tickets.

# 11.0.0 - 2024-07-01
fmt/base.hwhich provides a subset of the API with minimal include dependencies and enough functionality to replace all uses of theprintffamily of functions. This brings the compile time of code using {fmt} much closer to the equivalentprintfcode as shown on the following benchmark that compiles 100 source files: This gives almost 4x improvement in build speed compared to version 10. Note that the benchmark is purely formatting code and includes. In real projects the difference fromprintfwill be smaller partly because common standard headers will be included in almost any translation unit (TU) anyway. In particular, in every case exceptprintfabove ~1s is spent in total on including<type_traits>in all TUs.fmt/format.hwhich is now roughly equivalent to the oldfmt/core.hin terms of build speed.import stdenabled via theFMT_IMPORT_STDmacrofmt::range_format,fmt::range_format_kindandfmt::compiled_stringfrom thefmtmodulefmt::print, enabling direct writes into a C stream buffer in common cases. This may give significant performance improvements ranging from tens of percent to [2x]( https://stackoverflow.com/a/78457454/471164) and eliminates dynamic memory allocations on the buffer level. It is currently enabled for built-in and string types with wider availability coming up in future releases.fmt::format_towhen writing to an array For example no longer results in a buffer overflow. Instead the output will be truncated and you can get the end iterator and whether truncation occurred from theresultobject.FMT_UNICODEoption. Note that some {fmt} packages such as the one in vcpkg have already been compiled with Unicode enabled.std::expectedstd::complexstd::type_infoformatterforstd::basic_stringtypes with custom traits and allocatorsstd::chrono::day,std::chrono::month,std::chrono::yearandstd::chrono::year_month_dayFor example:```c++ #include <fmt/chrono.h> #include <fmt/color.h> int main() { fmt::print(fg(fmt::color::green), "{}\n", std::chrono::day(7)); }%S-specifier (glibcstrftimeextension) to day of the month (%d) and week of the year (%W,%U,%V) specifiers-extension in chrono formatting so that it doesn't apply to subsequent specifierstime_point::min()stringanddebug_stringrange formattersbeginandendinfmt::joinstd::basic_stringiteratorsbeginandendfmt::joinfmt::jointofmt/ranges.h, next to other overloads.fmt/base.hwhich provides a subset of the API with minimal include dependencies and enough functionality to replace all uses of theprintffamily of functions. This brings the compile time of code using {fmt} much closer to the equivalentprintfcode as shown on the following benchmark that compiles 100 source files: This gives almost 4x improvement in build speed compared to version 10. Note that the benchmark is purely formatting code and includes. In real projects the difference fromprintfwill be smaller partly because common standard headers will be included in almost any translation unit (TU) anyway. In particular, in every case exceptprintfabove ~1s is spent in total on including<type_traits>in all TUs.fmt/format.hwhich is now roughly equivalent to the oldfmt/core.hin terms of build speed.import stdenabled via theFMT_IMPORT_STDmacrofmt::range_format,fmt::range_format_kindandfmt::compiled_stringfrom thefmtmodulefmt::print, enabling direct writes into a C stream buffer in common cases. This may give significant performance improvements ranging from tens of percent to [2x]( https://stackoverflow.com/a/78457454/471164) and eliminates dynamic memory allocations on the buffer level. It is currently enabled for built-in and string types with wider availability coming up in future releases.beginreturningvoidsuch as Eigen matricesfmt::formattableconcept__float128(https://github.com/fmtlib/fmt/issues/3494).long doublewith fixed precisionfmt::isnannot trigger floating-point exception for NaN values<memory>forstd::allocator_traitswhen possiblefmt::printthat take text styles.fmt::iterator_buffer's move constructornoexceptformatter::formatis const for compatibility withstd::formatfmt::basic_format_arg::visitand deprecatedfmt::visit_format_arg.fmt::basic_string_viewnot constructible fromnullptrfor consistency withstd::string_viewin C++23fmt::group_digitsfor negative integersfmt::basic_format_args::getfmt::format_arg_storeand fixed moved constructionstd::back_insert_iterator