C++ Format v0.9.0 Release Notes
Release Date: 2014-05-13 // almost 10 years ago-
More efficient implementation of variadic formatting functions.
Writer::Format
now has a variadic overload:
.. code:: c++
Writer out; out.Format("Look, I'm {}!", "variadic");
- For efficiency and consistency with other overloads, variadic overload of
the
Format
function now returnsWriter
instead ofstd::string
. Use thestr
function to convert it tostd::string
:
.. code:: c++
std::string s = str(Format("Look, I'm {}!", "variadic"));
Replaced formatter actions with output sinks:
NoAction
->NullSink
,Write
->FileSink
,ColorWriter
->ANSITerminalSink
. This improves naming consistency and shouldn't affect client code unless these classes are used directly which should be rarely needed.โ Added
ThrowSystemError
function that formats a message and throwsSystemError
containing the formatted message and system-specific error description. For example, the following code
.. code:: c++
FILE *f = fopen(filename, "r"); if (!f) ThrowSystemError(errno, "Failed to open file '{}'") << filename;
will throw
SystemError
exception with description "Failed to open file '': No such file or directory" if file doesn't exist.๐ Support for AppVeyor continuous integration platform.
Format
now throwsSystemError
in case of I/O errors.๐ Improve test infrastructure. Print functions are now tested by redirecting the output to a pipe.