C++ Format v12.1.0 Release Notes
Release Date: 2025-10-29 // 8 months ago-
⚡️ Optimized
buffer::append, resulting in up to ~16% improvement on spdlog benchmarks (#4541). Thanks @fyrsta7.Worked around an ABI incompatibility in
std::locale_refbetween clang and gcc (#4573).Made
std::variantandstd::expectedformatters work withformat_as(#4574, #4575). Thanks @phprus.Made
fmt::join<string_view>work with C++ modules (#4379, #4577). Thanks @Arghnews.Exported
fmt::is_compiled_stringandoperator""_cffrom the module (#4544). Thanks @CrackedMatter.🛠 Fixed a compatibility issue with C++ modules in clang (#4548). Thanks @tsarn.
➕ Added support for cv-qualified types to the
std::optionalformatter (#4561, #4562). Thanks @OleksandrKvl.➕ Added demangling support (used in exception and
std::type_infoformatters) for libc++ and clang-cl (#4542, #4560, #4568, #4571). Thanks @FatihBAKIR and @rohitsutreja.🆓 Switched to global
malloc/freeto enable allocator customization (#4569, #4570). Thanks @rohitsutreja.👉 Made the
FMT_USE_CONSTEVALmacro configurable by users (#4546). Thanks @SnapperTT.🛠 Fixed compilation with locales disabled in the header-only mode (#4550).
🛠 Fixed compilation with clang 21 and
-std=c++20(#4552).🛠 Fixed a dynamic linking issue with clang-cl (#4576, #4584). Thanks @FatihBAKIR.
🛠 Fixed a warning suppression leakage on gcc (#4588). Thanks @ZedThree.
Made more internal color APIs
constexpr(#4581). Thanks @ishani.🛠 Fixed compatibility with clang as a host compiler for NVCC (#4564). Thanks @valgur.
🛠 Fixed various warnings and lint issues (#4565, #4572, #4557). Thanks @LiangHuDream and @teruyamato0731.
👌 Improved documentation (#4549, #4551, #4566, #4567, #4578,). Thanks @teruyamato0731, @petersteneteg and @zimmerman-dev.
Previous changes from v12.0.0
-
⚡️ Optimized the default floating point formatting (#3675, #4516). In particular, formatting a
doublewith format string compilation into a stack allocated buffer is more than 60% faster in version 12.0 compared to 11.2 according to dtoa-benchmark:➕ Added
constexprsupport tofmt::format. For example:Added
FMT_STATIC_FORMATthat allows formatting into a string of the exact required size at compile time.👌 Improved C++20 module support (#4451, #4459, #4476, #4488, #4491, #4495). Thanks @arBmind, @tkhyn, @Mishura4, @anonymouspc and @autoantwort.
Switched to using estimated display width in precision. For example:
🛠 Fix interaction between debug presentation, precision, and width for strings (#4478). Thanks @localspook.
Implemented allocator propagation on
basic_memory_buffermove (#4487, #4490). Thanks @toprakmurat.Fixed an ambiguity between
std::reference_wrapper<T>andformat_asformatters (#4424, #4434). Thanks @jeremy-rifkin.✂ Removed the following deprecated APIs:
🗄 Deprecated wide overloads of
fmt::fprintfandfmt::sprintf.👌 Improved diagnostics for the incorrect usage of
fmt::ptr(#4453). Thanks @TobiSchluter.Made handling of ANSI escape sequences more efficient (#4511, #4528). Thanks @localspook and @Anas-Hamdane.
🛠 Fixed a buffer overflow on all emphasis flags set (#4498). Thanks @dominicpoeschko.
🛠 Fixed an integer overflow for precision close to the max
intvalue.🛠 Fixed compatibility with WASI (#4496, #4497). Thanks @whitequark.
Fixed
back_insert_iteratordetection, preventing a fallback on slower path that handles arbitrary iterators (#4454).🛠 Fixed handling of invalid glibc
FILEbuffers (#4469).➕ Added
wchar_tsupport to thestd::byteformatter (#4479, #4480). Thanks @phprus.🏁 Changed component prefix from
fmt-tofmt_for compatibility with NSIS/CPack on Windows, e.g.fmt-docchanged tofmt_doc(#4441, #4442). Thanks @n-stein.Added the
FMT_CUSTOM_ASSERT_FAILmacro to simplify providing a customfmt::assert_failimplementation (#4505). Thanks @HazardyKnusperkeks.Switched to
FMT_THROWon reporting format errors so that it can be overriden by users when exceptions are disabled (#4521). Thanks @HazardyKnusperkeks.👌 Improved master project detection and disabled install targets when using {fmt} as a subproject by default (#4536). Thanks @crueter.
Made various code improvements (#4445, #4448, #4473, #4522). Thanks @localspook, @tchaikov and @way4sahil.
➕ Added Conan instructions to the docs (#4537). Thanks @uilianries.
✂ Removed Bazel files to avoid issues with downstream packaging (#4530). Thanks @mering.
➕ Added more entries for generated files to
.gitignore(#4355, #4512). Thanks @dinomight and @localspook.🛠 Fixed various warnings and compilation issues (#4447, #4470, #4474, #4477, #4471, #4483, #4515, #4533, #4534). Thanks @dodomorandi, @localspook, @remyjette, @Tomek-Stolarczyk, @Mishura4, @mattiasljungstrom and @FatihBAKIR.