Alignment, fill and width
Width and alignment are what turn a stream of values into a readable table, and the defaults differ
Width and alignment are what turn a stream of values into a readable table, and the defaults differ
spdlog's format strings are fmt's format strings — the same {} mini-language, with the same
std::milliseconds knows it's
Terminal color is a formatting concern, and fmt handles it with the same type-safe API used
Nearly every fmt bug that reaches production is a lifetime bug or a
The two incumbents fail in opposite directions — printf trades safety for speed and brevity,
The whole point of replacing printf is that a wrong format string shouldn't be a runtime surprise.
fmt's errors arrive in two flavours: a wall of template output at compile time, and a
Everything after the : in a replacement field is one small grammar. Learn it once and it applies to
A format string is a template with holes in it. Everything else in fmt — the spec grammar, custom
Extensibility is the thing printf can never have. A formatter specialization makes your own
fmt's runtime cost is settled — it's fast, and that doesn't change based on how you build it. Its
fmt can be dropped into a project as header-only, with no build step at all, or built and linked as
fmt::memory_buffer is the container fmt itself uses internally to build formatted output — a small
The two APIs are close enough that migration is mostly mechanical in either direction — the
fmt is locale-independent by default, and that is a feature, not an oversight — you opt in to
A codebase with hundreds of operator<< overloads doesn't need rewriting to adopt fmt. The ostream
fmt::string that you often immediately throw away — append it to
fmt is a fast, type-safe formatting library with Python-style replacement fields — {} holes in a
fmt is fast for structural reasons, not micro-optimizations — knowing which ones lets you tell when
Positional and named arguments exist for the same reason: the order of the holes in a format string
Printing a container is the single most common debugging need in C++, and it's the one thing the
std::format is fmt, standardised. P0645 took fmt's design into the C++20 standard library almost
Sign and precision are where formatted numbers stop being an aesthetic choice and start being a
One formatting engine, several entry points that differ only in where the characters land — pick
The final character of a spec picks a presentation, and the legal set of characters depends on the
fmt treats char-based strings as UTF-8. That's the right default for nearly every modern codebase,
C++ had two bad options for turning values into text: printf, which is fast and terse but