-
Optimized format string compilation resulting in up to 40% speed up in compiled
format_to
and ~4x speed up in compiledformat_to_n
on a concatenation benchmark (#3133, #3484).{fmt} 10.0:
--------------------------------------------------------- Benchmark Time CPU Iterations --------------------------------------------------------- BM_format_to 78.9 ns 78.9 ns 8881746 BM_format_to_n 568 ns 568 ns 1232089
{fmt} 10.1:
--------------------------------------------------------- Benchmark Time CPU Iterations --------------------------------------------------------- BM_format_to 54.9 ns 54.9 ns 12727944 BM_format_to_n 133 ns 133 ns 5257795
-
Optimized storage of an empty allocator in
basic_memory_buffer
(#3485). Thanks @Minty-Meeo. -
Added formatters for proxy references to elements of
std::vector<bool>
andstd::bitset<N>
(#3567, #3570). For example (godbolt):#include <vector> #include <fmt/std.h> int main() { auto v = std::vector<bool>{true}; fmt::print("{}", v[0]); }
Thanks @phprus (Vladislav Shchapov) and @felix642 (Félix-Antoine Constantin).
-
Fixed an ambiguous formatter specialization for containers that look like container adaptors such as
boost::flat_set
(#3556, #3561). Thanks @5chmidti. -
Fixed compilation when formatting durations not convertible from
std::chrono::seconds
(#3430). Thanks @patlkli (Patrick Geltinger). -
Made the
formatter
specialization forchar*
const-correct (#3432). Thanks @timsong-cpp. -
Made
{}
and{:}
handled consistently during compile-time checks (#3526). -
Disallowed passing temporaries to
make_format_args
to improve API safety by preventing dangling references. -
Improved the compile-time error for unformattable types (#3478). Thanks @BRevzin (Barry Revzin).
-
Improved the floating-point formatter (#3448, #3450). Thanks @florimond-collette (Florimond Collette).
-
Fixed handling of precision for
long double
larger than 64 bits. (#3539, #3564). -
Made floating-point and chrono tests less platform-dependent (#3337, #3433, #3434). Thanks @phprus (Vladislav Shchapov).
-
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 (#3551). Thanks @mjerabek (Martin Jeřábek). -
Made
FMT_THROW
assert even if assertions are disabled when compiling with exceptions disabled (#3418, #3439). Thanks @BRevzin (Barry Revzin). -
Made
format_as
andstd::filesystem::path
formatter work with exotic code unit types. (#3457, #3476). Thanks @gix (Nico Rieck), @hmbj (Hans-Martin B. Jensen). -
Deprecated the wide stream overload of
printf
. -
Removed unused
basic_printf_parse_context
. -
Improved RTTI detection used when formatting exceptions (#3468). Thanks @danakj (Dana Jansens).
-
Improved compatibility with VxWorks7 (#3467). Thanks @wenshan1 (Bin Lan).
-
Improved documentation (#3174, #3423, #3454, #3458, #3461, #3487, #3515). Thanks @zencatalyst (Kasra Hashemi), @rlalik, @mikecrowe (Mike Crowe).
-
Improved build and CI configurations (#3449, #3451, #3452, #3453, #3459, #3481, #3486, #3489, #3496, #3517, #3523, #3563). Thanks @joycebrum (Joyce), @glebm (Gleb Mazovetskiy), @phprus (Vladislav Shchapov), @petrmanek (Petr Mánek), @setoye (Alta), @abouvier (Alexandre Bouvier).
-
Fixed various warnings and compilation issues (#3408, #3424, #3444, #3446, #3475, #3482, #3492, #3493, #3508, #3509, #3533, #3542, #3543, #3540, #3544, #3548, #3549, #3550, #3552). Thanks @adesitter (Arnaud Desitter), @hmbj (Hans-Martin B. Jensen), @Minty-Meeo, @phprus (Vladislav Shchapov), @TobiSchluter (Tobias Schlüter), @kieranclancy (Kieran Clancy), @alexeedm (Dmitry Alexeev), @jurihock (Jürgen Hock), @Ozomahtli, @razaqq.
Pull Requests
- Fix time_point formatting for durations with certain ratios by @patlkli in #3430
- Make hex float test more stable by @phprus in #3434
- Always assert in FMT_THROW by @brevzin in #3439
- format-inl.h: address implicit int to bool conversion by @adesitter in #3446
- remove code duplication by @florimond-collette in #3448
- replace mod_inv_25 by explicit value as a fix for VS warning C4307 by @florimond-collette in #3450
- Fix parameter type of formatter<char*> by @timsong-cpp in #3432
- Hash pin Github Workflows by @joycebrum in #3451
- Create dependabot.yml by @joycebrum in #3452
- Update README.rst by @zencatalyst in #3454
- CMake: Do not fail on unknown compiler features by @glebm in #3453
- Fix example for user-defined types in documentation for 10.0.0 by @rlalik in #3461
- Make constexpr ceil by @phprus in #3459
- Pass correct Char to base format_as formatter by @gix in #3457
- Add VxWorks7 user space and kernel space support by @wenshan1 in #3467
- Only use typeid() in std.h when it is available by @danakj in #3468
- Fix MSVC warning in std::chrono::time_point formatter by @hmbj in #3475
- Use correct Char type in std::filesystem::path formatter by @hmbj in #3476
- Use FMT_TRY and FMT_CATCH in std.h by @Minty-Meeo in #3482
- Bump actions/checkout from 3.5.2 to 3.5.3 by @dependabot in #3486
- Give basic_memory_buffer allocator [[no_unique_address]] by @Minty-Meeo in #3485
- Fix for issue #3492 by @phprus in #3493
- Revert ae25f79 to restore capability to
cmake --install
when included as a subproject by @petrmanek in #3496 - Fix typo in assert message. by @TobiSchluter in #3508
- README: Add link to merged clang-tidy check by @mikecrowe in #3515
- Trying to improve errors in the unformattable case. by @brevzin in #3478
- fix missing header files when using CMake install by @setoye in #3523
- Fix format_string_checker initialisation order by @kieranclancy in #3542
- Turn off error-producing NVCC workaround when using c++20 by @alexeedm in #3544
- Remove std::copy usage. by @Ozomahtli in #3550
- expose detail::throw_format_error by @mjerabek in #3551
- Use the U literal for unsigned integer constants. by @jurihock in #3549
- Add missing inline specifier by @razaqq in #3552
- cmake: fix FMT_PKGCONFIG_DIR path by @abouvier in #3563
- fix ambiguous formatter lookup for flat_set by @5chmidti in #3561
- Added formatter for bit_reference-like types by @phprus in #3570
New Contributors
- @adesitter made their first contribution in #3446
- @florimond-collette made their first contribution in #3448
- @zencatalyst made their first contribution in #3454
- @rlalik made their first contribution in #3461
- @gix made their first contribution in #3457
- @wenshan1 made their first contribution in #3467
- @danakj made their first contribution in #3468
- @Minty-Meeo made their first contribution in #3482
- @dependabot made their first contribution in #3486
- @petrmanek made their first contribution in #3496
- @TobiSchluter made their first contribution in #3508
- @kieranclancy made their first contribution in #3542
- @alexeedm made their first contribution in #3544
- @Ozomahtli made their first contribution in #3550
- @mjerabek made their first contribution in #3551
- @jurihock made their first contribution in #3549
- @razaqq made their first contribution in #3552
- @abouvier made their first contribution in #3563
- @5chmidti made their first contribution in #3561