Boost Format library
The format library provides a class for formatting arguments according to a format-string,
as does printf, but with two major differences :
- format sends the arguments to an internal stream, and so is entirely type-safe and
naturally supports all user-defined types.
- The ellipsis (...) can not be used correctly in the strongly typed context of format,
and thus the function call with arbitrary arguments is replaced by successive calls to an
argument feeding operator%
You can find more Details in :
Submitted by Samuel Krempp.
- Documentation (HTML).
- Sample programs
- The program sample_formats.cpp
demonstrates simple uses of format.
illustrates the few formatting features that were added to printf's syntax such
as simple positional directives, centered alignment, and 'tabulations'.
demonstrates uses of advanced features, like reusing, and modifying,
format objects, etc..
- And sample_userType.cpp
shows the behaviour of the format library on user-defined types.