-
Added a C11 API that brings fast, type-safe formatting to C. The new
fmt-clibrary andfmt/fmt-c.hheader use_Genericto dispatch on argument types and outperformprintf/sprintf. For example:#include <fmt/fmt-c.h> fmt_print(stdout, "The answer is {}.\n", 42);
(#4663, #4671, #4696, #4693, #4694, #4712, #4789). Thanks @soumik15630m, @Ferdi265 and @localspook.
-
Added a separate
fmt::fmt-moduleCMake target for C++20 modules and a CI workflow that exercises module-based builds (#4684, #4685, #4707, #4708, #4702, #4709). Thanks @MathewBensonCode. -
Enabled the full Dragonbox lookup cache by default for floating-point formatting unless optimizing for binary size (
__OPTIMIZE_SIZE__), giving a ~10–25% speedup. Thanks Matthias Kretz for the suggestion. Average time perdoubleon Apple M1 Pro (clang 17, random digits, smaller is better) measured with dtoa-benchmark:Method Time (ns) fmt (full) 22.07 fmt (compact) 29.55 ryu 35.21 double-conversion 81.81 sprintf726.27 ostringstream864.34 -
Improved integer formatting performance by ~3% (#4630). Thanks @user202729.
-
Optimized formatting into back-insert iterators by using bulk container append/insert methods (e.g. on
std::vector<char>and custom string types) (#4679). Thanks @user202729. -
Reduced binary size of debug builds (~200k to ~85k in the bloat test) and improved compile speed when
constevalis unavailable. -
Made path formatting lossless, preserving ill-formed UTF-16 sequences when converting
std::filesystem::pathto a narrow string. -
Added support for formatting
std::unexpected(#4675). Thanks @17steen. -
Added overloads of
fmt::printlnthat take afmt::text_style(#4782). Thanks @ahoarau. -
Added support for positional arguments as width and precision specifiers in
fmt::printf(#4643). Thanks @KareemOtoum. -
Made
FMT_STRINGa no-op whenFMT_USE_CONSTEVALis enabled, since the consteval format-string constructor already provides compile-time validation (#4611, #4612). Thanks @friedkeenan. -
Promoted
fmt::detail::named_argto the public API asfmt::named_argand deprecated the detail alias (#4683, #4687). Thanks @TPPPP72. -
Moved the
std::byteformatter fromfmt/format.htofmt/std.h. -
Provided a default definition for
fmt::is_contiguous(#4731, #4770). Thanks @user202729 and @phprus. -
Added the
FMT_USE_FLOCKFILEmacro to disable the use offlockfile(#4646, #4666). Thanks @mvastola. -
Added
include_guard(GLOBAL)so that {fmt} can be used in multiple submodules of the same project (#4672). Thanks @torsten48. -
Improved
constexprsupport (#4659, #4591). Thanks @elbeno and @17steen. -
Deprecated the implicit conversion from
fmt::format_stringandfmt::basic_fstringtostring_viewto align withstd::format_string; useformat_string::get()instead. -
Opted out
std::complexfrom tuple formatting so that the dedicatedstd::complexformatter is always used. -
Removed the
fmt::sayfunction. -
Deprecated the
std::initializer_listoverload offmt::joinand the array overload offmt::vformat_to. -
Made the
<fmt/core.h>header equivalent to<fmt/base.h>by default. Code that relied on<fmt/core.h>pulling in<fmt/format.h>must now either include<fmt/format.h>directly or defineFMT_DEPRECATED_HEAVY_COREto opt back in. -
Improved
wchar_tsupport:fmt::joinnow acceptswchar_tand other non-charseparators, andfmt::format_to_nnow works withfmt::runtimeonwchar_t(#4686, #4714, #4715). Thanks @Yancey2023 and @sunmy2019. -
Fixed formatting of
std::tmwith a nulltm_zone(#4790). Thanks @Carmel0. -
Fixed compile-time formatting in
fmt/ranges.h,fmt/style.handfmt/std.h(#4759). Thanks @j4niwzis. -
Fixed an ambiguity between
formatter<std::optional<T>>infmt/std.handfmt/ranges.hon C++26 (P3168R2) (#4761). Thanks @phprus. -
Fixed a GCC PCH breakage triggered by a scoped
#pragma GCC optimize. -
Fixed a TSAN false positive in the locale handling code (#4755).
-
Fixed compile-time format string checks truncating string literals at an embedded null byte (#4732). Thanks @user202729.
-
Fixed out-of-bounds reads in
printfformatting (#4741, #4742, #4800). Thanks @Algunenano and @aizu-m. -
Fixed the return type of the
f(un)lockfilewrappers on Windows (#4739). Thanks @mvastola. -
Worked around a CUDA issue when handling UTF-32 literals (#4719). Thanks @Cazadorro.
-
Fixed missing named-argument validation for compiled format strings (#4638). Thanks @jaeheonshim.
-
Fixed
fmt::format_to_nin<fmt/compile.h>failing to compile when<iterator>is not transitively included (#4615). -
Fixed handling of pointers in format string compilation with
FMT_BUILTIN_TYPES=0. -
Stopped assuming nul termination of the format string in
fmt::printf. Thanks @ZUENS2020 for reporting. -
Fixed a build error when locale support is disabled (#4627). Thanks @marcel-behlau-elfin.
-
Fixed a fallback range formatter for types with a
container_typemember (#4123, #4660). Thanks @soumik15630m. -
Fixed various MSVC warnings, including C4305 and conversion warnings on x86 (#4668, #4594). Thanks @kanren3 and @blizzard4591.
-
Updated the Android Gradle Plugin to 9.x (#4651, #4658). Thanks @soumik15630m.
-
Made various code, build and test improvements (#4625, #4639, #4644, #4656, #4680, #4681, #4704, #4710, #4713, #4729, #4751, #4758, #4799). Thanks @ZephyrLykos, @togunchan, @KaganCanSit, @berndpetrovitsch, @Skylion007, @st0rmbtw, @localspook and @EXtremeExploit.
-
Improved documentation, including a rewrite of the format string syntax, better handling of doxygen tags, documenting
output_file, fixing CSS so that whitespace is displayed properly, and various smaller fixes (#4622, #4626, #4631, #4667, #4616, #4748). Thanks @heavywatal, @ZephyrLykos, @user202729, @ssszcmawo, @bigmoonbit and @Powerbyte7. -
Added building of release artifacts and SLSA provenance in CI, added a CodeQL workflow, and added the security policy in
.github/SECURITY.md.