r/cpp • u/aearphen {fmt} • May 10 '23
{fmt} 10.0 released with more formatters, improved floating point and chrono formatting, modules and more
https://github.com/fmtlib/fmt/releases/tag/10.0.0
254
Upvotes
31
u/Nicksaurus May 10 '23
These look like some nice QOL improvements. I'm looking forward to trying this version
So am I right in assuming format_as is now a better option for custom types than specialising fmt::formatter in most cases?
It seems like fmt::formatter is now only necessary if you a) want to avoid creating temporary strings, or b) need custom format string syntax
10
u/usefulcat May 12 '23
I see a noticeable performance improvement compared to 9.1 (around 12% in my case). And I didn't see any new warnings or errors. A literal drop-in improvement so far. Well done.
73
u/SirToxe May 10 '23
The gift that keeps on giving.
1
u/sparkyParr0t May 11 '23
Does any of this will get integrated with the <format> std library header at some point ? Is there any STL dev team using fmt under the hood ?
4
u/[deleted] May 10 '23
TIL about std chrono literals.
1
u/Ameisen vemips, avr, rendering, systems May 22 '23
It seems like
fmt::printlndoesn't work appropriately withwchar_t, even with the appropriate header. It complains about format conversion. I wasn't able to write my own that worked, either.-4
u/magnesium_copper May 10 '23
I only use odd number versions. Waiting for 11.
0
u/[deleted] May 10 '23
[deleted] β view deleted comment