Trumphurst Ltd.

Submit a comment to an "Available C++ Libraries FAQ" entry

CategoryLibraries available to download (D-L)

FastFormat - 100% type-safe, infinitely extensible, very high performance C++ format library

FastFormat is an open source C++ formatting library, whose design parameters are 100% type-safety, efficiency, and flexibility. It is simple to use, highly-portable (platform and compiler-independent), and is infinitely extensible.

FastFormat supports output/formatting of statements of arbitrary complexity, consisting of heterogeneous types. It provides two APIs:

FastFormat writes to output "sinks", which can be of arbitrary type. It implicitly supports any type that is structurally conformant with the standard library's string, and the library includes adaptors to allow writing to:

Adaptation to a new type requires the definition of a single function.

FastFormat is robust. Both APIs are 100% type-safe - something no other C/C++ widely-used formatting library can claim - and with the Write API it is impossible to compile defective code.

FastFormat is fast. The processing of each statement involves at most one memory allocation to hold the entire statement, and each statement element is measured and copied exactly once. As a consequence, the library is on a par with (the type-unsafe) C's Streams (printf()-family) of functions, faster than C++'s IOStreams (by 2-10x) and Loki.SafeFormat (by 1-5x), and considerably faster than Boost.Format (by 5-17x).

FastFormat supports I18N/L10N by using numbered arguments, enabling reordering of arguments by exchanging format strings. The library comes with a number of resource bundles, classes whose instances can load sets of localised resource strings for use as format strings.

FastFormat does not contain any compiler-specific or platform-specific constructs. It supports UNIX (including Linux and Mac OS-X), and Windows, and should work with any operating system. It is known to be compatible with Comeau (4.3.3+), GCC (3.4+), Intel (8+), Metrowerks (8+), Microsoft Visual C++ (6.0+), and should work with any reasonably modern C++ compiler.

FastFormat is completely free and includes source released under a BSD-style license. Commercial customisations and related consultancy are provided by Synesis Software.

FastFormat features in a series of articles in ACCU's peer-reviewed Overload magazine:

Examples:

Performance:

FastFormat's performance has been extensively tested, and in every case it has superior performance to the C++ standard library's IOStreams, Boost.Format and Loki.SafeFormat. In most cases it has equivalent performance to the (type-unsafe) C standard library's Streams (printf()-family). Test results are included on the project website, and in the first in the Overload article series; the third article in the series has a further set of four performance tests, based on real-world uses of FastFormat in commercial projects.

Features:

Requirements:

    STLSoft libraries (1.9.1 beta 81 or later); 100% header-only open-source.


Do not expect an immediate response - the contents of this form will be added to a queue, which I process manually about once a week. If you don't fill in your email address correctly, you will not (obviously) get any reply at all. Other invalid information may result in a mailed request for clarification.

Enter your comment in the areas provided below. Be sure to include your name and email address.

Please don't bother trying to post spam or links to dodgy web sites - everything you post here is reviewed by a human being before being released for public viewing.


Your Name
Your Email Address
Comment:

Click to submit your comment.
Up to the FAQ title page

For more information on any of Trumphurst's products and services, please


This page, and all contents, are Copyright © 1997-2017 by
Trumphurst Ltd.
The Willows
Canalside
St. Martins Moor
Oswestry
Shropshire
SY10 7BH
England.
Contact us
www.trumphurst.com is hosted by JumboCruiser.