Socializing with {fmt}

Speaker: Daniela Engert

Audience level: Beginner | Intermediate

category

Experiences from introducing the {fmt} string formatting library into an existing application code base.

String formatting and text output are a mixed bag in C++ even 20 years after it first standardization:

  • stream-based io is type-safe and the idiomatic C++ solution from the standard library, but it is despiced by many people because they deem it expensive in various metrics and tedious to use
  • C-style io on the other hand is very fast and familiar to most people, but it lacks type-safety and requires due diligence by programmers to use it correctly and safely

Frameworks like Qt (or others) offer their own solutions to that problem, and so does f.e. Boost. For various reasons, none of these became widely popular and acceptable to many users. With the advent of Modern C++, richer language features open-up new opportunities to tackle this long-standing scar on C++'s face. The {fmt} library tries to address the mentioned shortcomings, and has therefore gained some traction in the recent past. It is also proposed for inclusion into the C++ standard library, currently progressing through the standards committee.

The talk will give an introduction to and a short overview of {fmt}, its offerings to adapt and to exend it to *your* types, how it can interact with existing frameworks, and what the story on localization is.