Up to [cvs.NetBSD.org] / pkgsrc / textproc / fmtlib
Request diff between arbitrary revisions
Keyword substitution: kv
Default branch: MAIN
fmtlib: update to 12.2.1.
# 12.2.1 - 2026-11-07
- Fixed a heap buffer overflow on 32-bit targets when the size of a formatting
buffer overflows, e.g. `fmt::format(L"{:>{}}", s, 1100000000)`. Such
allocations now throw `std::bad_alloc`.
- Fixed an out-of-bounds read when parsing format specifiers of
`std::error_code` (https://github.com/fmtlib/fmt/pull/4934).
Thanks @IfkumRfnl.
- Fixed a crash when formatting `nullptr` with `FMT_COMPILE` and an exception
in `fmt::to_string(nullptr)`; both now format it as `0x0`
(https://github.com/fmtlib/fmt/pull/4993). Thanks @INo-xious.
fmtlib: update to 12.2.0.
# 12.2.0 - 2026-06-16
- Added a C11 API that brings fast, type-safe formatting to C. The new
`fmt-c` library and `fmt/fmt-c.h` header use `_Generic` to dispatch on
argument types and outperform `printf`/`sprintf`. For example:
```c++
#include <fmt/fmt-c.h>
fmt_print(stdout, "The answer is {}.\n", 42);
```
(https://github.com/fmtlib/fmt/issues/4663,
https://github.com/fmtlib/fmt/pull/4671,
https://github.com/fmtlib/fmt/pull/4696,
https://github.com/fmtlib/fmt/issues/4693,
https://github.com/fmtlib/fmt/pull/4694,
https://github.com/fmtlib/fmt/pull/4712,
https://github.com/fmtlib/fmt/pull/4789).
Thanks @Soumik15630m, @Ferdi265 and @localspook.
- Added a separate `fmt::fmt-module` CMake target for C++20 modules and a
CI workflow that exercises module-based builds
(https://github.com/fmtlib/fmt/issues/4684,
https://github.com/fmtlib/fmt/pull/4685,
https://github.com/fmtlib/fmt/issues/4707,
https://github.com/fmtlib/fmt/pull/4708,
https://github.com/fmtlib/fmt/pull/4702,
https://github.com/fmtlib/fmt/pull/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 per `double` on Apple M1 Pro (clang 17, random digits,
smaller is better) measured with
[dtoa-benchmark](https://github.com/fmtlib/dtoa-benchmark):
| Method | Time (ns) |
| ----------------------- | --------: |
| fmt (full) | 22.07 |
| fmt (compact) | 29.55 |
| ryu | 35.21 |
| double-conversion | 81.81 |
| `sprintf` | 726.27 |
| `ostringstream` | 864.34 |
- Improved integer formatting performance by ~3%
(https://github.com/fmtlib/fmt/pull/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) (https://github.com/fmtlib/fmt/pull/4679). Thanks @user202729.
- Reduced binary size of debug builds (~200k to ~85k in the bloat test) and
improved compile speed when `consteval` is unavailable.
- Made path formatting lossless, preserving ill-formed UTF-16
sequences when converting `std::filesystem::path` to a narrow string.
- Added support for formatting `std::unexpected`
(https://github.com/fmtlib/fmt/pull/4675). Thanks @17steen.
- Added overloads of `fmt::println` that take a `fmt::text_style`
(https://github.com/fmtlib/fmt/pull/4782). Thanks @ahoarau.
- Added support for positional arguments as width and precision specifiers
in `fmt::printf` (https://github.com/fmtlib/fmt/pull/4643).
Thanks @KareemOtoum.
- Made `FMT_STRING` a no-op when `FMT_USE_CONSTEVAL` is enabled, since the
consteval format-string constructor already provides compile-time
validation
(https://github.com/fmtlib/fmt/issues/4611,
https://github.com/fmtlib/fmt/pull/4612). Thanks @friedkeenan.
- Promoted `fmt::detail::named_arg` to the public API as `fmt::named_arg` and
deprecated the detail alias
(https://github.com/fmtlib/fmt/issues/4683,
https://github.com/fmtlib/fmt/pull/4687). Thanks @TPPPP72.
- Moved the `std::byte` formatter from `fmt/format.h` to `fmt/std.h`.
- Provided a default definition for `fmt::is_contiguous`
(https://github.com/fmtlib/fmt/pull/4731,
https://github.com/fmtlib/fmt/pull/4770). Thanks @user202729 and @phprus.
- Added the `FMT_USE_FLOCKFILE` macro to disable the use of `flockfile`
(https://github.com/fmtlib/fmt/issues/4646,
https://github.com/fmtlib/fmt/pull/4666). Thanks @mvastola.
- Added `include_guard(GLOBAL)` so that {fmt} can be used in multiple
submodules of the same project
(https://github.com/fmtlib/fmt/pull/4672). Thanks @torsten48.
- Improved `constexpr` support
(https://github.com/fmtlib/fmt/pull/4659,
https://github.com/fmtlib/fmt/pull/4591).
Thanks @elbeno and @17steen.
- Deprecated the implicit conversion from `fmt::format_string` and
`fmt::basic_fstring` to `string_view` to align with `std::format_string`;
use `format_string::get()` instead.
- Opted out `std::complex` from tuple formatting so that the dedicated
`std::complex` formatter is always used.
- Removed the `fmt::say` function.
- Deprecated the `std::initializer_list` overload of `fmt::join` and the array
overload of `fmt::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 define
`FMT_DEPRECATED_HEAVY_CORE` to opt back in.
- Improved `wchar_t` support: `fmt::join` now accepts `wchar_t` and other
non-`char` separators, and `fmt::format_to_n` now works with `fmt::runtime`
on `wchar_t`
(https://github.com/fmtlib/fmt/pull/4686,
https://github.com/fmtlib/fmt/issues/4714,
https://github.com/fmtlib/fmt/pull/4715).
Thanks @Yancey2023 and @sunmy2019.
- Fixed formatting of `std::tm` with a null `tm_zone`
(https://github.com/fmtlib/fmt/pull/4790). Thanks @Carmel0.
- Fixed compile-time formatting in `fmt/ranges.h`, `fmt/style.h` and
`fmt/std.h` (https://github.com/fmtlib/fmt/pull/4759). Thanks @j4niwzis.
- Fixed an ambiguity between `formatter<std::optional<T>>` in `fmt/std.h`
and `fmt/ranges.h` on C++26 (P3168R2)
(https://github.com/fmtlib/fmt/pull/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
(https://github.com/fmtlib/fmt/issues/4755).
- Fixed compile-time format string checks truncating string literals at
an embedded null byte
(https://github.com/fmtlib/fmt/pull/4732). Thanks @user202729.
- Fixed out-of-bounds reads in `printf` formatting
(https://github.com/fmtlib/fmt/issues/4741,
https://github.com/fmtlib/fmt/pull/4742,
https://github.com/fmtlib/fmt/pull/4800).
Thanks @Algunenano and @aizu-m.
- Fixed the return type of the `f(un)lockfile` wrappers on Windows
(https://github.com/fmtlib/fmt/pull/4739). Thanks @mvastola.
- Worked around a CUDA issue when handling UTF-32 literals
(https://github.com/fmtlib/fmt/pull/4719). Thanks @Cazadorro.
- Fixed missing named-argument validation for compiled format strings
(https://github.com/fmtlib/fmt/pull/4638). Thanks @JaeheonShim.
- Fixed `fmt::format_to_n` in `<fmt/compile.h>` failing to compile when
`<iterator>` is not transitively included
(https://github.com/fmtlib/fmt/issues/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
(https://github.com/fmtlib/fmt/pull/4627). Thanks @marcel-behlau-elfin.
- Fixed a fallback range formatter for types with a `container_type` member
(https://github.com/fmtlib/fmt/issues/4123,
https://github.com/fmtlib/fmt/pull/4660). Thanks @Soumik15630m.
- Fixed C++20 concept detection
(https://github.com/fmtlib/fmt/pull/4653). Thanks @tearfur.
- Fixed a clang compilation failure
(https://github.com/fmtlib/fmt/pull/4718). Thanks @mccakit.
- Fixed various MSVC warnings, including C4305 and conversion warnings on
x86 (https://github.com/fmtlib/fmt/pull/4668,
https://github.com/fmtlib/fmt/pull/4594).
Thanks @kanren3 and @blizzard4591.
- Updated the Android Gradle Plugin to 9.x
(https://github.com/fmtlib/fmt/issues/4651,
https://github.com/fmtlib/fmt/pull/4658). Thanks @Soumik15630m.
- Made various code, build and test improvements
(https://github.com/fmtlib/fmt/pull/4625,
https://github.com/fmtlib/fmt/pull/4639,
https://github.com/fmtlib/fmt/pull/4644,
https://github.com/fmtlib/fmt/pull/4656,
https://github.com/fmtlib/fmt/pull/4680,
https://github.com/fmtlib/fmt/pull/4681,
https://github.com/fmtlib/fmt/pull/4704,
https://github.com/fmtlib/fmt/pull/4710,
https://github.com/fmtlib/fmt/pull/4713,
https://github.com/fmtlib/fmt/pull/4729,
https://github.com/fmtlib/fmt/pull/4751,
https://github.com/fmtlib/fmt/pull/4758,
https://github.com/fmtlib/fmt/pull/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
(https://github.com/fmtlib/fmt/pull/4622,
https://github.com/fmtlib/fmt/pull/4626,
https://github.com/fmtlib/fmt/pull/4631,
https://github.com/fmtlib/fmt/pull/4667,
https://github.com/fmtlib/fmt/pull/4616,
https://github.com/fmtlib/fmt/pull/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`.
fmtlib: update to 12.1.0. # 12.1.0 - 2025-10-29 - Optimized `buffer::append`, resulting in up to ~16% improvement on spdlog benchmarks (https://github.com/fmtlib/fmt/pull/4541). Thanks @fyrsta7. - Worked around an ABI incompatibility in `std::locale_ref` between clang and gcc (https://github.com/fmtlib/fmt/issues/4573). - Made `std::variant` and `std::expected` formatters work with `format_as` (https://github.com/fmtlib/fmt/issues/4574, https://github.com/fmtlib/fmt/pull/4575). Thanks @phprus. - Made `fmt::join<string_view>` work with C++ modules (https://github.com/fmtlib/fmt/issues/4379, https://github.com/fmtlib/fmt/pull/4577). Thanks @Arghnews. - Exported `fmt::is_compiled_string` and `operator""_cf` from the module (https://github.com/fmtlib/fmt/pull/4544). Thanks @CrackedMatter. - Fixed a compatibility issue with C++ modules in clang (https://github.com/fmtlib/fmt/pull/4548). Thanks @tsarn. - Added support for cv-qualified types to the `std::optional` formatter (https://github.com/fmtlib/fmt/issues/4561, https://github.com/fmtlib/fmt/pull/4562). Thanks @OleksandrKvl. - Added demangling support (used in exception and `std::type_info` formatters) for libc++ and clang-cl (https://github.com/fmtlib/fmt/issues/4542, https://github.com/fmtlib/fmt/pull/4560, https://github.com/fmtlib/fmt/issues/4568, https://github.com/fmtlib/fmt/pull/4571). Thanks @FatihBAKIR and @rohitsutreja. - Switched to global `malloc`/`free` to enable allocator customization (https://github.com/fmtlib/fmt/issues/4569, https://github.com/fmtlib/fmt/pull/4570). Thanks @rohitsutreja. - Made the `FMT_USE_CONSTEVAL` macro configurable by users (https://github.com/fmtlib/fmt/pull/4546). Thanks @SnapperTT. - Fixed compilation with locales disabled in the header-only mode (https://github.com/fmtlib/fmt/issues/4550). - Fixed compilation with clang 21 and `-std=c++20` (https://github.com/fmtlib/fmt/issues/4552). - Fixed a dynamic linking issue with clang-cl (https://github.com/fmtlib/fmt/issues/4576, https://github.com/fmtlib/fmt/pull/4584). Thanks @FatihBAKIR. - Fixed a warning suppression leakage on gcc (https://github.com/fmtlib/fmt/pull/4588). Thanks @ZedThree. - Made more internal color APIs `constexpr` (https://github.com/fmtlib/fmt/pull/4581). Thanks @ishani. - Fixed compatibility with clang as a host compiler for NVCC (https://github.com/fmtlib/fmt/pull/4564). Thanks @valgur. - Fixed various warnings and lint issues (https://github.com/fmtlib/fmt/issues/4565, https://github.com/fmtlib/fmt/pull/4572, https://github.com/fmtlib/fmt/pull/4557). Thanks @LiangHuDream and @teruyamato0731. - Improved documentation (https://github.com/fmtlib/fmt/issues/4549, https://github.com/fmtlib/fmt/pull/4551, https://github.com/fmtlib/fmt/issues/4566, https://github.com/fmtlib/fmt/pull/4567, https://github.com/fmtlib/fmt/pull/4578,). Thanks @teruyamato0731, @petersteneteg and @zimmerman-dev.
fmtlib: update to 12.0.0.
# 12.0.0 - 2025-09-17
- Optimized the default floating point formatting
(https://github.com/fmtlib/fmt/issues/3675,
https://github.com/fmtlib/fmt/issues/4516). In particular, formatting a
`double` with 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](https://github.com/fmtlib/dtoa-benchmark):
```
Function Time (ns) Speedup
fmt11 34.471 1.00x
fmt12 21.000 1.64x
```
<img width="766" height="609" src="https://github.com/user-attachments/assets/d7d768ad-7543-468c-b0bb-449abf73b31b" />
- Added `constexpr` support to `fmt::format`. For example:
```c++
#include <fmt/compile.h>
using namespace fmt::literals;
std::string s = fmt::format(""_cf, 42);
```
now works at compile time provided that `std::string` supports `constexpr`
(https://github.com/fmtlib/fmt/issues/3403,
https://github.com/fmtlib/fmt/pull/4456). Thanks @msvetkin.
- Added `FMT_STATIC_FORMAT` that allows formatting into a string of the exact
required size at compile time.
For example:
```c++
#include <fmt/compile.h>
constexpr auto s = FMT_STATIC_FORMAT("{}", 42);
```
compiles to just
```s
__ZL1s:
.asciiz "42"
```
It can be accessed as a C string with `s.c_str()` or as a string view with
`s.str()`.
- Improved C++20 module support
- Switched to using estimated display width in precision. For example:
```c++
fmt::print("|{:.4}|\n|1234|\n", "๐ฑ๐ฑ๐ฑ");
```
prints

because `๐ฑ` has an estimated width of 2
- Fix interaction between debug presentation, precision, and width for strings
- Implemented allocator propagation on `basic_memory_buffer` move
- Fixed an ambiguity between `std::reference_wrapper<T>` and `format_as`
formatters
- Removed the following deprecated APIs:
- `has_formatter`: use `is_formattable` instead,
- `basic_format_args::parse_context_type`,
`basic_format_args::formatter_type` and similar aliases in context types,
- wide stream overload of `fmt::printf`,
- wide stream overloads of `fmt::print` that take text styles,
- `is_*char` traits,
- `fmt::localtime`.
- Deprecated wide overloads of `fmt::fprintf` and `fmt::sprintf`.
- Improved diagnostics for the incorrect usage of `fmt::ptr`
- Made handling of ANSI escape sequences more efficient
- Fixed a buffer overflow on all emphasis flags set
- Fixed an integer overflow for precision close to the max `int` value.
- Fixed compatibility with WASI (https://github.com/fmtlib/fmt/issues/4496,
- Fixed `back_insert_iterator` detection, preventing a fallback on slower path
that handles arbitrary iterators
- Fixed handling of invalid glibc `FILE` buffers
- Added `wchar_t` support to the `std::byte` formatter
- Changed component prefix from `fmt-` to `fmt_` for compatibility with
NSIS/CPack on Windows, e.g. `fmt-doc` changed to `fmt_doc`
- Added the `FMT_CUSTOM_ASSERT_FAIL` macro to simplify providing a custom
`fmt::assert_fail` implementation
- Switched to `FMT_THROW` on reporting format errors so that it can be
overriden by users when exceptions are disabled
- Improved master project detection and disabled install targets when using
{fmt} as a subproject by default
- Made various code improvements
- Added Conan instructions to the docs
- Removed Bazel files to avoid issues with downstream packaging
- Added more entries for generated files to `.gitignore`
- Fixed various warnings and compilation issues
fmtlib: update to 11.2.0.
# 11.2.0 - 2025-05-03
- Added the `s` specifier for `std::error_code`. It allows formatting an error
message as a string. For example:
```c++
#include <fmt/std.h>
int main() {
auto ec = std::make_error_code(std::errc::no_such_file_or_directory);
fmt::print("{:s}\n", ec);
}
```
prints
```
No such file or directory
```
(The actual message is platform-specific.)
- Fixed formatting of `std::chrono::local_time` and `tm`
For example ([godbolt](https://www.godbolt.org/z/8o4b1PPn5)):
```c++
#include <fmt/chrono.h>
int main() {
std::chrono::zoned_time zt(
std::chrono::current_zone(),
std::chrono::system_clock::now());
fmt::print("{}", zt.get_local_time());
}
```
is now formatted consistenly across platforms.
- Added diagnostics for cases when timezone information is not available.
For example:
```c++
fmt::print("{:Z}", std::chrono::local_seconds());
```
now gives a compile-time error.
- Deprecated `fmt::localtime` in favor of `std::localtime`.
- Fixed compilation with GCC 15 and C++20 modules enabled
- Fixed handling of named arguments in format specs
- Added error reporting for duplicate named arguments
- Fixed formatting of `long` with `FMT_BUILTIN_TYPES=0`
- Optimized `text_style` using bit packing
- Added support for incomplete types
- Fixed a flush issue in `fmt::print` when using libstdc++
- Fixed `fmt::println` usage with `FMT_ENFORCE_COMPILE_STRING` and legacy
compile-time checks
- Removed legacy header `fmt/core.h` from docs
- Worked around limitations of `__builtin_strlen` during constant evaluation
- Worked around a bug in MSVC v141
- Removed the `fmt_detail` namespace
- Removed specializations of `std::is_floating_point` in tests
- Fixed a CMake error when setting `CMAKE_MODULE_PATH` in the pedantic mode
- Updated the Bazel config
fmtlib: updated to 11.1.4 11.1.4 - 2025-02-26 - Fixed ABI compatibility with earlier 11.x versions on Windows - Improved the logic of switching between fixed and exponential format for `float` - Moved `is_compiled_string` to the public API - Simplified implementation of `operator""_cf` - Fixed `__builtin_strlen` detection - Fixed handling of BMI paths with the Ninja generator - Fixed gcc 8.3 compile errors - Fixed a bogus MSVC warning
fmtlib: updated to 11.1.3 11.1.3 Fixed compilation on GCC 9.4 Worked around an internal compiler error when using C++20 modules with GCC 14.2 and earlier Worked around a bug in GCC 6 Fixed an issue caused by instantiating formatter<const T> Fixed formatting into std::ostreambuf_iterator when using format string compilation Restored a constraint on the map formatter so that it correctly reports as unformattable when the element is Reduced the size of format specs Readded args() to fmt::format_context Fixed a bogus MSVC warning Fixed a pedantic mode error in the CMake config
fmtlib: updated to 11.1.2
11.1.2
Fixed ABI compatibility with earlier 11.x versions
Added wchar_t support to the std::bitset formatter
Prefixed CMake components with fmt- to simplify usage of {fmt} via add_subdirectory
Updated docs for meson
Fixed a compilation error in chrono on nvcc
Fixed various warnings
fmtlib: updated to 11.1.1
11.1.1
Fixed ABI compatibility with earlier 11.x versions
Defined CMake components (core and doc) to allow docs to be installed separately
11.1.0
Improved C++20 module support
Reduced debug (unoptimized) binary code size and the number of template instantiations when passing formatting arguments. For example, unoptimized binary code size for fmt::print("{}", 42) was reduced by ~40% on GCC and ~60% on clang (x86-64).
GCC:
Before: 161 instructions of which 105 are in reusable functions (godbolt).
After: 116 instructions of which 60 are in reusable functions (godbolt).
Clang:
Before: 310 instructions of which 251 are in reusable functions (godbolt).
After: 194 instructions of which 135 are in reusable functions (godbolt).
Added an experimental fmt::writer API that can be used for writing to different destinations such as files or strings
Added width and alignment support to the formatter of std::error_code.
Made std::expected<void, E> formattable.
Made fmt::is_formattable<void> SFINAE-friendly
Added support for _BitInt formatting when using clang
Added the n specifier for tuples and pairs
Added support for tuple-like types to fmt::join
Made more types formattable at compile time
Implemented a more efficient compile-time fmt::formatted_size
Fixed compile-time formatting of some string types
Made compiled version of fmt::format_to work with std::back_insert_iterator<std::vector<char>>
Added a formatter for std::reference_wrapper
Added experimental padding support (glibc strftime extension) to %m, %j and %Y
Made microseconds formatted as us instead of ยตs if the Unicode support is disabled
Fixed an unreleased regression in transcoding of surrogate pairs
Made fmt::appender satisfy std::output_iterator concept
Made std::iterator_traits<fmt::appender> standard-conforming
Made it easier to reuse fmt::formatter<std::string_view> for types with an implicit conversion to std::string_view
Made it possible to disable <filesystem> use via FMT_CPP_LIB_FILESYSTEM for compatibility with some video game console SDKs, e.g. Nintendo Switch SDK
Fixed compatibility with platforms that use 80-bit long double
Added support for UTF-32 code units greater than 0xFFFF in fill
Fixed handling of legacy encodings on Windows with GCC
Made fmt::to_string take fmt::basic_memory_buffer by const reference
Added fmt::dynamic_format_arg_store::size
Removed the ability to control locale usage via an undocumented FMT_STATIC_THOUSANDS_SEPARATOR in favor of FMT_USE_LOCALE.
Renamed FMT_EXCEPTIONS to FMT_USE_EXCEPTIONS for consistency with other similar macros.
Improved include directory ordering to reduce the chance of including incorrect headers when using multiple versions of {fmt}
Made it possible to compile a subset of {fmt} without the C++ runtime.
Improved documentation and README
Improved the documentation generator
Improved CI
Fixed various warnings and compilation issues
*: replace CMAKE_ARGS with CMAKE_CONFIGURE_ARGS
fmtlib: updated to 11.0.2 11.0.2 Fixed compatibility with non-POSIX systems Fixed performance regressions when using std::back_insert_iterator with fmt::format_to Fixed handling of std::generator and move-only iterators Made formatter<std::string_view>::parse work with types convertible to std::string_view Made volatile void* formattable Made Glib::ustring not be confused with std::string Made fmt::context iterator compatible with STL algorithms that rely on iterator category
Update fmtlib to 11.0.1 Many improvemnts. Highlights include: - Added formatters for `std::chrono::day`, `std::chrono::month`, `std::chrono::year` and `std::chrono::year_month_day` - Fixed handling of precision in `%S` (https://github.com/fmtlib/fmt/issues/3794, - Added a formatter for `std::complex` - Added a formatter for `std::expected` - Added a formatter for `std::type_info` and much faster compile times even without using the new cut down fmt/base.h which provides the printf() equivalent family of functions. For a full list see https://github.com/fmtlib/fmt/blob/11.0.1/ChangeLog.md
fmtlib: updated to 10.2.1
10.2.1 - 2024-01-03
- Fixed ABI compatibility with earlier 10.x versions
10.2.0 - 2024-01-01
- Added support for the `%j` specifier (the number of days) for
`std::chrono::duration`
- Added support for the chrono suffix for days and changed
the suffix for minutes from "m" to the correct "min"
For example ([godbolt](https://godbolt.org/z/9KhMnq9ba)):
```c++
#include <fmt/chrono.h>
int main() {
fmt::print("{}\n", std::chrono::days(42)); // prints "42d"
}
```
- Fixed an overflow in `std::chrono::time_point` formatting with large dates
- Added a formatter for `std::source_location`
For example ([godbolt](https://godbolt.org/z/YajfKjhhr)):
```c++
#include <source_location>
#include <fmt/std.h>
int main() {
fmt::print("{}\n", std::source_location::current());
}
```
prints
```
/app/example.cpp:5:51: int main()
```
- Added a formatter for `std::bitset`
```c++
#include <bitset>
#include <fmt/std.h>
int main() {
fmt::print("{}\n", std::bitset<6>(42)); // prints "101010"
}
```
- Added an experimental `nested_formatter` that provides an easy way of
applying a formatter to one or more subobjects while automatically handling
width, fill and alignment. For example:
```c++
#include <fmt/format.h>
struct point {
double x, y;
};
template <>
struct fmt::formatter<point> : nested_formatter<double> {
auto format(point p, format_context& ctx) const {
return write_padded(ctx, [=](auto out) {
return format_to(out, "({}, {})", nested(p.x), nested(p.y));
});
}
};
int main() {
fmt::print("[{:>20.2f}]", point{1, 2});
}
```
prints
```
[ (1.00, 2.00)]
```
- Added the generic representation (`g`) to `std::filesystem::path`
```c++
#include <filesystem>
#include <fmt/std.h>
int main() {
fmt::print("{:g}\n", std::filesystem::path("C:\\foo"));
}
```
prints `"C:/foo"` on Windows.
- Made `format_as` work with references
- Fixed formatting of invalid UTF-8 with precision
- Fixed an inconsistency between `fmt::to_string` and `fmt::format`
- Disallowed unsafe uses of `fmt::styled`
```c++
auto s = fmt::styled(std::string("dangle"), fmt::emphasis::bold);
fmt::print("{}\n", s); // compile error
```
Pass `fmt::styled(...)` as a parameter instead.
- Added a null check when formatting a C string with the `s` specifier
- Disallowed the `c` specifier for `bool`
- Made the default formatting unlocalized in `fmt::ostream_formatter` for
consistency with the rest of the library
- Fixed localized formatting in bases other than decimal
- Fixed a performance regression in experimental `fmt::ostream::print`
- Added synchronization with the underlying output stream when writing to
the Windows console
- Changed to only export `format_error` when {fmt} is built as a shared
library
- Made `fmt::streamed` `constexpr`.
- Enabled `consteval` on older versions of MSVC
- Added an option to build without `wchar_t` support on Windows
- Improved build and CI configuration
- Fixed various warnings, compilation and test issues
- Improved documentation and README
- Updated CI dependencies
fmtlib: updated to 10.1.1 10.1.1 Added formatters for std::atomic and atomic_flag Fixed an error about partial specialization of formatter<string> after instantiation when compiled with gcc and C++20 Fixed compilation as a C++20 module with gcc and clang Made fmt::to_string work with types that have format_as overloads Made formatted_size work with integral format specifiers at compile time Fixed a warning about the no_unique_address attribute on clang-cl Improved compatibility with the legacy GBK encoding Added OpenSSF Scorecard analysis Updated CI dependencies
fmtlib: update to 10.1.0
From the release information on GitHub:
* Optimized format string compilation resulting in up to 40% speed up
in compiled format_to and ~4x speed up in compiled format_to_n on a
concatenation benchmark
* Optimized storage of an empty allocator in basic_memory_buffer
* Added formatters for proxy references to elements of
std::vector<bool> and std::bitset<N>
* Fixed an ambiguous formatter specialization for containers that look
like container adaptors such as boost::flat_set
* Fixed compilation when formatting durations not convertible from
std::chrono::seconds
* Made the formatter specialization for char* const-correct
* Made {} and {:} handled consistently during compile-time checks
* Disallowed passing temporaries to make_format_args to improve API
safety by preventing dangling references
* Improved the compile-time error for unformattable types
* Improved the floating-point formatter
* Fixed handling of precision for long double larger than 64 bits
* Made floating-point and chrono tests less platform-dependent
* Removed the remnants of the Grisu floating-point formatter that has
been replaced by Dragonbox in earlier versions
* Added throw_format_error to the public API
* Made FMT_THROW assert even if assertions are disabled when compiling
with exceptions disabled
* Added support for the ? format specifier to std::filesystem::path
and made the default unescaped for consistency with strings
* Made format_as and std::filesystem::path formatter work with exotic
code unit types
* Deprecated the wide stream overload of printf
* Removed unused basic_printf_parse_context.
* Improved RTTI detection used when formatting exceptions
* Improved compatibility with VxWorks7
* Improved documentation
* Improved build and CI configurations
* Fixed various warnings and compilation issues
fmtlib: update to 10.0.0.
10.0.0 - 2023-05-09
-------------------
* Replaced Grisu with a new floating-point formatting algorithm for given
precision
The new algorithm is based on Dragonbox already used for the
shortest representation and gives substantial performance improvement:
* Replaced ``snprintf``-based hex float formatter with an internal
implementation
This removes the last usage of ``s(n)printf`` in {fmt}.
* Fixed alignment of floating-point numbers with localization
* Improved C++20 module support
Switched to the `modules CMake library <https://github.com/vitaut/modules>`_
which allows building {fmt} as a C++20 module with clang::
CXX=clang++ cmake -DFMT_MODULE=ON .
make
* Made ``format_as`` work with any user-defined type and not just enums.
For example (`godbolt <https://godbolt.org/z/b7rqhq5Kh>`__):
.. code:: c++
#include <fmt/format.h>
struct floaty_mc_floatface {
double value;
};
auto format_as(floaty_mc_floatface f) { return f.value; }
int main() {
fmt::print("{:8}\n", floaty_mc_floatface{0.42}); // prints " 0.42"
}
* Removed deprecated implicit conversions for enums and conversions to primitive
types for compatibility with ``std::format`` and to prevent potential ODR
violations. Use ``format_as`` instead.
* Added support for fill, align and width to the time point formatter
* Implemented formatting of subseconds
* Added precision support to ``%S``
* Added support for ``std::utc_time``
* Switched formatting of ``std::chrono::system_clock`` from local time to UTC
for compatibility with the standard
* Added support for ``%Ez`` and ``%Oz`` to chrono formatters.
* Improved validation of format specifiers for ``std::chrono::duration``
* Fixed formatting of time points before the epoch
* Experimental: implemented glibc extension for padding seconds, minutes and
hours
* Added a formatter for ``std::exception``
* Moved ``std::error_code`` formatter from ``fmt/os.h`` to ``fmt/std.h``.
* Added formatters for standard container adapters: ``std::priority_queue``,
``std::queue`` and ``std::stack``
* Added a formatter for ``std::optional`` to ``fmt/std.h``.
* Fixed formatting of valueless by exception variants
* Made ``fmt::ptr`` accept ``unique_ptr`` with a custom deleter
* Fixed formatting of noncopyable ranges and nested ranges of chars
* Fixed issues with formatting of paths and ranges of paths
* Improved handling of invalid Unicode in paths.
* Enabled compile-time checks on Apple clang 14 and later
* Improved compile-time checks of named arguments
* Fixed formatting when both alignment and ``0`` are given
* Improved Unicode support in the experimental file API on Windows
* Unified UTF transcoding
* Added support for UTF-8 digit separators via an experimental locale facet
* Added an overload of ``formatted_size`` that takes a locale
* Removed the deprecated ``FMT_DEPRECATED_OSTREAM``.
* Fixed a UB when using a null ``std::string_view`` with ``fmt::to_string``
or format string compilation
* Added ``starts_with`` to the fallback ``string_view`` implementation
* Added ``fmt::basic_format_string::get()`` for compatibility with
``basic_format_string``
* Added ``println`` for compatibility with C++23
* Improved documentation
* Improved build configuration and tests
* Fixed a regression in handling empty format specifiers after a colon (``{:}``)
* Worked around a broken implementation of ``std::is_constant_evaluated`` in
some versions of libstdc++ on clang
* Fixed formatting of volatile variables
* Fixed various warnings and compilation issues
*: convert to cmake/build.mk
fmtlib: update to 9.1.0
From Wongboo via Github pull request.
Closes NetBSD/pkgsrc#111.
9.1.0 - 2022-08-27
------------------
* ``fmt::formatted_size`` now works at compile time
. For example
(`godbolt <https://godbolt.org/z/1MW5rMdf8>`__):
.. code:: c++
#include <fmt/compile.h>
int main() {
using namespace fmt::literals;
constexpr size_t n = fmt::formatted_size("{}"_cf, 42);
fmt::print("{}\n", n); // prints 2
}
* Fixed handling of invalid UTF-8.
* Improved Unicode support in ``ostream`` overloads of ``print``.
* Fixed handling of the sign specifier in localized formatting on systems with
32-bit ``wchar_t`` .
* Added support for wide streams to ``fmt::streamed``.
* Added the ``n`` specifier that disables the output of delimiters when
formatting ranges.
For example (`godbolt <https://godbolt.org/z/roKqGdj8c>`__):
.. code:: c++
#include <fmt/ranges.h>
#include <vector>
int main() {
auto v = std::vector{1, 2, 3};
fmt::print("{:n}\n", v); // prints 1, 2, 3
}
* Worked around problematic ``std::string_view`` constructors introduced in
C++23
* Improve handling (exclusion) of recursive ranges
* Improved error reporting in format string compilation.
* Improved the implementation of
`Dragonbox <https://github.com/jk-jeon/dragonbox>`_, the algorithm used for
the default floating-point formatting.
* Fixed issues with floating-point formatting on exotic platforms.
* Improved the implementation of chrono formatting.
* Improved documentation.
* Improved build configuration.
* Fixed various warnings and compilation issues.
9.0.0 - 2022-07-04
------------------
* Switched to the internal floating point formatter for all decimal presentation
formats. In particular this results in consistent rounding on all platforms
and removing the ``s[n]printf`` fallback for decimal FP formatting.
* Compile-time floating point formatting no longer requires the header-only
mode. For example (`godbolt <https://godbolt.org/z/G37PTeG3b>`__):
.. code:: c++
#include <array>
#include <fmt/compile.h>
consteval auto compile_time_dtoa(double value) -> std::array<char, 10> {
auto result = std::array<char, 10>();
fmt::format_to(result.data(), FMT_COMPILE("{}"), value);
return result;
}
constexpr auto answer = compile_time_dtoa(0.42);
works with the default settings.
* Improved the implementation of
`Dragonbox <https://github.com/jk-jeon/dragonbox>`_, the algorithm used for
the default floating-point formatting.
* Made ``fmt::to_string`` work with ``__float128``. This uses the internal
FP formatter and works even on system without ``__float128`` support in
``[s]printf``.
* Disabled automatic ``std::ostream`` insertion operator (``operator<<``)
discovery when ``fmt/ostream.h`` is included to prevent ODR violations.
You can get the old behavior by defining ``FMT_DEPRECATED_OSTREAM`` but this
will be removed in the next major release. Use ``fmt::streamed`` or
``fmt::ostream_formatter`` to enable formatting via ``std::ostream`` instead.
* Added ``fmt::ostream_formatter`` that can be used to write ``formatter``
specializations that perform formatting via ``std::ostream``.
For example (`godbolt <https://godbolt.org/z/5sEc5qMsf>`__):
.. code:: c++
#include <fmt/ostream.h>
struct date {
int year, month, day;
friend std::ostream& operator<<(std::ostream& os, const date& d) {
return os << d.year << '-' << d.month << '-' << d.day;
}
};
template <> struct fmt::formatter<date> : ostream_formatter {};
std::string s = fmt::format("The date is {}", date{2012, 12, 9});
// s == "The date is 2012-12-9"
* Added the ``fmt::streamed`` function that takes an object and formats it
via ``std::ostream``.
For example (`godbolt <https://godbolt.org/z/5G3346G1f>`__):
.. code:: c++
#include <thread>
#include <fmt/ostream.h>
int main() {
fmt::print("Current thread id: {}\n",
fmt::streamed(std::this_thread::get_id()));
}
Note that ``fmt/std.h`` provides a ``formatter`` specialization for
``std::thread::id`` so you don't need to format it via ``std::ostream``.
* Deprecated implicit conversions of unscoped enums to integers for consistency
with scoped enums.
* Added an argument-dependent lookup based ``format_as`` extension API to
simplify formatting of enums.
* Added experimental ``std::variant`` formatting support.
For example (`godbolt <https://godbolt.org/z/KG9z6cq68>`__):
.. code:: c++
#include <variant>
#include <fmt/std.h>
int main() {
auto v = std::variant<int, std::string>(42);
fmt::print("{}\n", v);
}
prints::
variant(42)
Thanks `@jehelset <https://github.com/jehelset>`_.
* Added experimental ``std::filesystem::path`` formatting support
(`#2865 <https://github.com/fmtlib/fmt/issues/2865>`_,
`#2902 <https://github.com/fmtlib/fmt/pull/2902>`_,
`#2917 <https://github.com/fmtlib/fmt/issues/2917>`_,
`#2918 <https://github.com/fmtlib/fmt/pull/2918>`_).
For example (`godbolt <https://godbolt.org/z/o44dMexEb>`__):
.. code:: c++
#include <filesystem>
#include <fmt/std.h>
int main() {
fmt::print("There is no place like {}.", std::filesystem::path("/home"));
}
prints::
There is no place like "/home".
* Added a ``std::thread::id`` formatter to ``fmt/std.h``.
For example (`godbolt <https://godbolt.org/z/j1azbYf3E>`__):
.. code:: c++
#include <thread>
#include <fmt/std.h>
int main() {
fmt::print("Current thread id: {}\n", std::this_thread::get_id());
}
* Added ``fmt::styled`` that applies a text style to an individual argument.
.
For example (`godbolt <https://godbolt.org/z/vWGW7v5M6>`__):
.. code:: c++
#include <fmt/chrono.h>
#include <fmt/color.h>
int main() {
auto now = std::chrono::system_clock::now();
fmt::print(
"[{}] {}: {}\n",
fmt::styled(now, fmt::emphasis::bold),
fmt::styled("error", fg(fmt::color::red)),
"something went wrong");
}
* Made ``fmt::print`` overload for text styles correctly handle UTF-8.
* Fixed Unicode handling when writing to an ostream.
* Added support for nested specifiers to range formatting:
.. code:: c++
#include <vector>
#include <fmt/ranges.h>
int main() {
fmt::print("{::#x}\n", std::vector{10, 20, 30});
}
prints ``[0xa, 0x14, 0x1e]``.
* Implemented escaping of wide strings in ranges.
* Added support for ranges with ``begin`` / ``end`` found via the
argument-dependent lookup.
* Fixed formatting of certain kinds of ranges of ranges.
* Fixed handling of maps with element types other than ``std::pair``.
* Made tuple formatter enabled only if elements are formattable.
* Made ``fmt::join`` compatible with format string compilation.
* Made compile-time checks work with named arguments of custom types and
``std::ostream`` ``print`` overloads.
* Removed ``make_args_checked`` because it is no longer needed for compile-time.
* Removed the following deprecated APIs: ``_format``, ``arg_join``,
the ``format_to`` overload that takes a memory buffer,
``[v]fprintf`` that takes an ``ostream``.
* Removed the deprecated implicit conversion of ``[const] signed char*`` and
``[const] unsigned char*`` to C strings.
* Removed the deprecated ``fmt/locale.h``.
* Replaced the deprecated ``fileno()`` with ``descriptor()`` in
``buffered_file``.
* Moved ``to_string_view`` to the ``detail`` namespace since it's an
implementation detail.
* Made access mode of a created file consistent with ``fopen`` by setting
``S_IWGRP`` and ``S_IWOTH``.
* Removed a redundant buffer resize when formatting to ``std::ostream``.
* Made precision computation for strings consistent with width.
.
* Fixed handling of locale separators in floating point formatting.
* Made sign specifiers work with ``__int128_t``.
* Improved support for systems such as CHERI with extra data stored in pointers.
* Improved documentation.
* Improved build configuration.
* Fixed various warnings and compilation issues.
fmtlib: updated to 8.1.1
8.1.1 - 2022-01-06
------------------
* Restored ABI compatibility with version 8.0.x
* Fixed chorno formatting on big endian systems
* Fixed a linkage error with mingw
8.1.0 - 2022-01-02
------------------
* Optimized chrono formatting
Processing of some specifiers such as ``%z`` and ``%Y`` is now up to 10-20
times faster, for example on GCC 11 with libstdc++::
----------------------------------------------------------------------------
Benchmark Before After
----------------------------------------------------------------------------
FMTFormatter_z 261 ns 26.3 ns
FMTFormatterCompile_z 246 ns 11.6 ns
FMTFormatter_Y 263 ns 26.1 ns
FMTFormatterCompile_Y 244 ns 10.5 ns
----------------------------------------------------------------------------
* Implemented subsecond formatting for chrono durations
For example (`godbolt <https://godbolt.org/z/es7vWTETe>`__):
.. code:: c++
#include <fmt/chrono.h>
int main() {
fmt::print("{:%S}", std::chrono::milliseconds(1234));
}
prints "01.234".
* Fixed handling of precision 0 when formatting chrono durations
* Fixed an overflow on invalid inputs in the ``tm`` formatter
* Added ``fmt::group_digits`` that formats integers with a non-localized digit
separator (comma) for groups of three digits.
For example (`godbolt <https://godbolt.org/z/TxGxG9Poq>`__):
.. code:: c++
#include <fmt/format.h>
int main() {
fmt::print("{} dollars", fmt::group_digits(1000000));
}
prints "1,000,000 dollars".
* Added support for faint, conceal, reverse and blink text styles
* Added experimental support for compile-time floating point formatting
It is currently limited to the header-only mode.
* Added UDL-based named argument support to compile-time format string checks
For example (`godbolt <https://godbolt.org/z/ohGbbvonv>`__):
.. code:: c++
#include <fmt/format.h>
int main() {
using namespace fmt::literals;
fmt::print("{answer:s}", "answer"_a=42);
}
gives a compile-time error on compilers with C++20 ``consteval`` and non-type
template parameter support (gcc 10+) because ``s`` is not a valid format
specifier for an integer.
* Implemented escaping of string range elements.
For example (`godbolt <https://godbolt.org/z/rKvM1vKf3>`__):
.. code:: c++
#include <fmt/ranges.h>
#include <vector>
int main() {
fmt::print("{}", std::vector<std::string>{"\naan"});
}
is now printed as::
["\naan"]
instead of::
["
aan"]
* Switched to JSON-like representation of maps and sets for consistency with
Python's ``str.format``.
For example (`godbolt <https://godbolt.org/z/seKjoY9W5>`__):
.. code:: c++
#include <fmt/ranges.h>
#include <map>
int main() {
fmt::print("{}", std::map<std::string, int>{{"answer", 42}});
}
is now printed as::
{"answer": 42}
* Extended ``fmt::join`` to support C++20-only ranges
* Optimized handling of non-const-iterable ranges and implemented initial
support for non-const-formattable types.
* Disabled implicit conversions of scoped enums to integers that was
accidentally introduced in earlier versions
* Deprecated implicit conversion of ``[const] signed char*`` and
``[const] unsigned char*`` to C strings.
* Deprecated ``_format``, a legacy UDL-based format API
* Marked ``format``, ``formatted_size`` and ``to_string`` as ``[[nodiscard]]``
* Added missing diagnostic when trying to format function and member pointers
as well as objects convertible to pointers which is explicitly disallowed
* Optimized writing to a contiguous buffer with ``format_to_n``
* Optimized writing to non-``char`` buffers
* Decimal point is now localized when using the ``L`` specifier.
* Improved floating point formatter implementation
* Fixed handling of very large precision in fixed format
* Made a table of cached powers used in FP formatting static
* Resolved a lookup ambiguity with C++20 format-related functions due to ADL
* Removed unnecessary inline namespace qualification
* Implemented argument forwarding in ``format_to_n``
* Fixed handling of implicit conversions in ``fmt::to_string`` and format string
compilation
* Changed the default access mode of files created by ``fmt::output_file`` to
``-rw-r--r--`` for consistency with ``fopen``
* Make ``fmt::ostream::flush`` public
* Improved C++14/17 attribute detection
* Improved documentation
* Improved fuzzers and added a fuzzer for chrono timepoint formatting
* Added the ``FMT_SYSTEM_HEADERS`` CMake option setting which marks {fmt}'s
headers as system. It can be used to suppress warnings
* Added the Bazel build system support
* Improved build configuration and tests
* Fixed various warnings and compilation issues
fmtlib: updated to 8.0.1
8.0.1:
Fixed the version number in the inline namespace
Added a missing presentation type check for std::string
Fixed a linkage error when mixing code built with clang and gcc
Fixed documentation issues
Removed dead code in FP formatter
Fixed various warnings and compilation issues
8.0.0:
Enabled compile-time format string check by default.
Added compile-time formatting
Optimized handling of format specifiers during format string compilation. For example, hexadecimal formatting ("{:x}") is now 3-7x faster than before when using format_to with format string compilation and a stack-allocated buffer
Added the _cf user-defined literal to represent a compiled format string. It can be used instead of the FMT_COMPILE macro
Format string compilation now requires format functions of formatter specializations for user-defined types to be const
Added UDL-based named argument support to format string compilation
Added format string compilation support to fmt::print
Added initial support for compiling {fmt} as a C++20 module
Made symbols private by default reducing shared library size. For example there was a ~15% reported reduction on one platform
Optimized includes making the result of preprocessing fmt/format.h ~20% smaller with libstdc++/C++20 and slightly improving build times
Added support of ranges with non-const begin / end
Added support of std::byte and other formattable types to fmt::join
Implemented the default format for std::chrono::system_clock
Made more chrono specifiers locale independent by default. Use the 'L' specifier to get localized formatting.
Improved locale handling in chrono formatting
fmtlib: updated to 7.1.3 7.1.3 Fixed handling of buffer boundaries in format_to_n. Fixed linkage errors when linking with a shared library. Reintroduced ostream support to range formatters. Worked around an issue with mixing std versions in gcc 7.1.2 Fixed floating point formatting with large precision. 7.1.1 Fixed ABI compatibility with 7.0.x. Added the FMT_ARM_ABI_COMPATIBILITY macro to work around ABI incompatibility between GCC and Clang on ARM. Worked around a SFINAE bug in GCC 8. Fixed linkage errors when building with GCC's LTO. Fixed a compilation error when building without __builtin_clz or equivalent. Fixed a sign conversion warning. 7.1.0 Switched from Grisu3 to Dragonbox for the default floating-point formatting which gives the shortest decimal representation with round-trip guarantee and correct rounding. Added an experimental unsynchronized file output API which, together with format string compilation, can give 5-9 times speed up compared to fprintf on common platforms. Added a formatter for std::chrono::time_point<system_clock>. Added support for ranges with non-const begin/end to fmt::join. Added a memory_buffer::append overload that takes a range. Improved handling of single code units in FMT_COMPILE. Added dynamic width support to format string compilation. Improved error reporting for unformattable types: now you'll get the type name directly in the error message instead of the note. Added the make_args_checked function template that allows you to write formatting functions with compile-time format string checks and avoid binary code bloat. Replaced snprintf fallback with a faster internal IEEE 754 float and double formatter for arbitrary precision. Made format_to_n and formatted_size part of the core API. Added fmt::format_to_n overload with format string compilation. Added fmt::format_to overload that take text_style. Made the # specifier emit trailing zeros in addition to the decimal point. Changed the default floating point format to not include .0 for consistency with std::format and std::to_chars. It is possible to get the decimal point and trailing zero with the # specifier. Fixed an issue with floating-point formatting that could result in addition of a non-significant trailing zero in rare cases e.g. 1.00e-34 instead of 1.0e-34. Made fmt::to_string fallback on ostream insertion operator if the formatter specialization is not provided. Added support for the append mode to the experimental file API and improved fcntl.h detection. Fixed handling of types that have both an implicit conversion operator and an overloaded ostream insertion operator. Fixed a slicing issue in an internal iterator type. Fixed an issue in locale-specific integer formatting. Fixed handling of exotic code unit types. Improved FMT_ALWAYS_INLINE. Removed dependency on windows.h. Optimized counting of decimal digits on MSVC. Improved documentation. Added the FMT_REDUCE_INT_INSTANTIATIONS CMake option that reduces the binary code size at the cost of some integer formatting performance. This can be useful for extremely memory-constrained embedded systems. Added the FMT_USE_INLINE_NAMESPACES macro to control usage of inline namespaces. Improved build configuration
fmtlib: updated to 7.0.3
7.0.3:
* Worked around broken ``numeric_limits`` for 128-bit integers
* Added error reporting on missing named arguments
* Stopped using 128-bit integers with clang-cl
* Fixed issues in locale-specific integer formatting
7.0.2:
* Worked around broken ``numeric_limits`` for 128-bit integers
* Fixed compatibility with CMake 3.4
* Fixed handling of digit separators in locale-specific formatting
7.0.1:
* Updated the inline version namespace name.
* Worked around a gcc bug in mangling of alias templates
* Fixed a linkage error on Windows
* Fixed minor issues with the documentation.
7.0.0:
* Reduced the library size. For example, on macOS a stripped test binary
statically linked with {fmt} `shrank from ~368k to less than 100k
* Added a simpler and more efficient `format string compilation API
* Optimized integer formatting: ``format_to`` with format string compilation
and a stack-allocated buffer is now `faster than to_chars on both
libc++ and libstdc++
* Optimized handling of small format strings.
* Applied extern templates to improve compile times when using the core API
and ``fmt/format.h``
For example, on macOS with clang the compile time of a test translation unit
dropped from 2.3s to 0.3s with ``-O2`` and from 0.6s to 0.3s with the default
settings (``-O0``).
* Named arguments are now stored on stack (no dynamic memory allocations) and
the compiled code is more compact and efficient.
* Implemented compile-time checks for dynamic width and precision
* Added sentinel support to ``fmt::join``
* Added support for named args, ``clear`` and ``reserve`` to
``dynamic_format_arg_store``
* Added support for the ``'c'`` format specifier to integral types for
compatibility with ``std::format``
* Replaced the ``'n'`` format specifier with ``'L'`` for compatibility with
``std::format``
The ``'n'`` specifier can be enabled via the ``FMT_DEPRECATED_N_SPECIFIER``
macro.
* The ``'='`` format specifier is now disabled by default for compatibility with
``std::format``. It can be enabled via the ``FMT_DEPRECATED_NUMERIC_ALIGN``
macro.
* Removed the following deprecated APIs:
* ``FMT_STRING_ALIAS`` and ``fmt`` macros - replaced by ``FMT_STRING``
* ``fmt::basic_string_view::char_type`` - replaced by
``fmt::basic_string_view::value_type``
* ``convert_to_int``
* ``format_arg_store::types``
* ``*parse_context`` - replaced by ``*format_parse_context``
* ``FMT_DEPRECATED_INCLUDE_OS``
* ``FMT_DEPRECATED_PERCENT`` - incompatible with ``std::format``
* ``*writer`` - replaced by compiled format API
* Renamed the ``internal`` namespace to ``detail``
* Improved compatibility between ``fmt::printf`` with the standard specs
* Fixed handling of ``operator<<`` overloads that use ``copyfmt``
* Added the ``FMT_OS`` CMake option to control inclusion of OS-specific APIs
in the fmt target. This can be useful for embedded platforms
* Replaced ``FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION`` with the ``FMT_FUZZ``
macro to prevent interferring with fuzzing of projects using {fmt}
* Fixed compatibility with emscripten
* Improved documentation
* Implemented various build configuration fixes and improvements
* Fixed various warnings and compilation issues
fmtlib: updated to 6.2.1 6.2.1 Fixed ostream support in sprintf Fixed type detection when using implicit conversion to string_view and ostream operator<< inconsistently
fmtlib: updated to 6.2.0 6.2.0: * Improved error reporting when trying to format an object of a non-formattable type * Reduced library size by ~10%. * Always print decimal point if # is specified * Implemented the 'L' specifier for locale-specific numeric formatting to improve compatibility with std::format. The 'n' specifier is now deprecated and will be removed in the next major release. * Moved OS-specific APIs such as windows_error from fmt/format.h to fmt/os.h. You can define FMT_DEPRECATED_INCLUDE_OS to automatically include fmt/os.h from fmt/format.h for compatibility but this will be disabled in the next major release. * Added precision overflow detection in floating-point formatting. * Implemented detection of invalid use of fmt::arg. * Used type_identity to block unnecessary template argument deduction. * Improved UTF-8 handling * Added experimental dynamic argument storage * Made fmt::join accept initializer_list * Fixed handling of empty tuples * Fixed handling of output iterators in format_to_n * Fixed formatting of std::chrono::duration types to wide output * Added const begin and end overload to buffers * Added the ability to disable floating-point formatting via FMT_USE_FLOAT, FMT_USE_DOUBLE and FMT_USE_LONG_DOUBLE macros for extremely memory-constrained embedded system * Made FMT_STRING work with constexpr string_view * Implemented a minor optimization in the format string parser * Improved attribute detection * Improved documentation * Fixed symbol visibility on Linux when compiling with -fvisibility=hidden * Implemented various build configuration fixes and improvements * Fixed various warnings and compilation issues
fmtlib: updated to 6.1.2 6.1.2: Fixed ABI compatibility with libfmt.so.6.0.0. Fixed handling types convertible to std::string_view. Made CUDA test an opt-in enabled via the FMT_CUDA_TEST CMake option. Fixed sign conversion warnings.
fmtlib: updated to 6.1.1
6.1.1:
Fixed shared library build on Windows.
Added a missing decimal point in exponent notation with trailing zeros.
Removed deprecated format_arg_store::TYPES.
6.1.0:
{fmt} now formats IEEE 754 float and double using the shortest decimal representation with correct rounding by default.
Made the fast binary to decimal floating-point formatter the default, simplified it and improved performance. {fmt} is now 15 times faster than libc++'s std::ostringstream, 11 times faster than printf and 10% faster than double-conversion on dtoa-benchmark.
{fmt} no longer converts float arguments to double. In particular this improves the default (shortest) representation of floats and makes fmt::format consistent with std::for.
Made floating-point formatting output consistent with printf/iostreams.
Added support for 128-bit integers.
The overload of print that takes text_style is now atomic, i.e. the output from different threads doesn't interleave.
Made compile time in the header-only mode ~20% faster by reducing the number of template instantiations. wchar_t overload of vprint was moved from fmt/core.h to fmt/format.h.
Added an overload of fmt::join that works with tuples.
Changed formatting of octal zero with prefix from "00" to "0.
The locale is now passed to ostream insertion (<<) operators.
Locale-specific number formatting now uses groupin.
Fixed handling of types with deleted implicit rvalue conversion to const char**.
Enums are now mapped to correct underlying types instead of int.
Enum classes are no longer implicitly converted to int.
Added basic_format_parse_context for consistency with C++20 std::format and deprecated basic_parse_context.
Fixed handling of UTF-8 in precision.
{fmt} can now be installed on Linux, macOS and Windows with Conda using its conda-forge package.
Added a CUDA test.
fmtlib: updated to 6.0.0 6.0.0: Switched to the MIT license with an optional exception that allows distributing binary code without attribution. Floating-point formatting is now locale-independent by default. Added an experimental Grisu floating-point formatting algorithm implementation (disabled by default). To enable it compile with the FMT_USE_GRISU macro defined to 1. Separated formatting and parsing contexts for consistency with C++20 std::format, removing the undocumented basic_format_context::parse_context() function. Added oss-fuzz support. formatter specializations now always take precedence over operator<<. Introduced the experimental fmt::compile function that does format string compilation. Added the % format specifier that formats floating-point values as percentages. Implemented precision for floating-point durations. Implemented chrono format specifiers %Q and %q that give the value and the unit respectively . Fixed handling of dynamic width in chrono formatter. Removed deprecated fmt/time.h. Use fmt/chrono.h instead. Added fmt::format and fmt::vformat overloads that take text_style. Removed the deprecated color API (print_colored). Use the new API, namely print overloads that take text_style instead. Made std::unique_ptr and std::shared_ptr formattable as pointers via fmt::ptr. Made print and vprint report I/O errors. Marked deprecated APIs with the [[deprecated]] attribute and removed internal uses of deprecated APIs. Modernized the codebase using more C++11 features and removing workarounds. Most importantly, buffer_context is now an alias template, so use buffer_context<T> instead of buffer_context<T>::type. These features require GCC 4.8 or later. formatter specializations now always take precedence over implicit conversions to int and the undocumented convert_to_int trait is now deprecated. Moved the undocumented basic_writer, writer, and wwriter types to the internal namespace. Removed deprecated basic_format_context::begin(). Use out() instead. Disallowed passing the result of join as an lvalue to prevent misuse. Refactored the undocumented structs that represent parsed format specifiers to simplify the API and allow multibyte fill. Moved SFINAE to template parameters to reduce symbol sizes. Switched to fputws for writing wide strings so that it's no longer required to call _setmode on Windows.
fmtlib: updated to 5.3.0 5.3.0: * Introduced experimental chrono formatting support * Added experimental support for emphasis (bold, italic, underline, strikethrough), colored output to a file stream, and improved colored formatting API * Added support for 4-bit terminal colors * Parameterized formatting functions on the type of the format string. Any object of type S that has an overloaded to_string_view(const S&) returning fmt::string_view can be used as a format string * Made std::string_view work as a format string * Added wide string support to compile-time format string checks * Made colored print functions work with wide strings * Introduced experimental Unicode support * Improved locale support * Constrained formatting functions on proper iterator types * Added make_printf_args and make_wprintf_args functions * Deprecated fmt::visit, parse_context, and wparse_context. Use fmt::visit_format_arg, format_parse_context, and wformat_parse_context instead. * Removed undocumented basic_fixed_buffer which has been superseded by the iterator-based API * Disallowed repeated leading zeros in an argument ID * Reintroduced support for gcc 4.4 * Fixed compilation on platforms with exotic double * Improved documentation * Added pkgconfig support which makes it easier to consume the library from meson and other build systems
fmtlib: added version 5.2.1 fmt (formerly cppformat) is an open-source formatting library. It can be used as a fast and safe alternative to printf and IOStreams.