single |
{fmt} is an open-source formatting library providing a fast and safe
alternative to C stdio and C++ iostreams.
Features
- Simple format API with positional arguments for localization
- Implementation of C++20 std::format
- Format string syntax similar to Python's format
- Fast IEEE 754 floating-point formatter with correct rounding, shortness
and round-trip guarantees
- Safe printf implementation including the POSIX extension for positional
arguments
- Extensibility: support for user-defined types
- High performance: faster than common standard library implementations
of (s)printf, iostreams, to_string and to_chars, see Speed tests and
Converting a hundred million integers to strings per second
- Small code size both in terms of source code with the minimum
configuration consisting of just three files, core.h, format.h and
format-inl.h, and compiled code; see Compile time and code bloat
- Reliability: the library has an extensive set of fuzz tests
- Safety: the library is fully type safe, errors in format strings can be
reported at compile time, automatic memory management prevents buffer
overflow errors
- Ease of use: small self-contained code base, no external dependencies,
permissive MIT license
- Portability with consistent output across platforms and old compilers
- Clean warning-free codebase even on high warning levels
- Locale-independence by default
- Optional header-only configuration enabled with the FMT_HEADER_ONLY macro
|