C++ Format v4.0.0 Release Notes
Release Date: 2017-06-27 // almost 7 years ago-
โ Removed old compatibility headers
cppformat/*.h
and CMake options (#527 <https://github.com/fmtlib/fmt/pull/527>
). Thanks@maddinat0r (Alex Martin) <https://github.com/maddinat0r>
.โ Added
string.h
containingfmt::to_string()
as alternative tostd::to_string()
as well as other string writer functionality (#326 <https://github.com/fmtlib/fmt/issues/326>
_ and#441 <https://github.com/fmtlib/fmt/pull/441>
_):
.. code:: c++
#include "fmt/string.h" std::string answer = fmt::to_string(42);
Thanks to
@glebov-andrey (Andrey Glebov) <https://github.com/glebov-andrey>
_.- ๐ Moved
fmt::printf()
to newprintf.h
header and allowed%s
as generic specifier (#453 <https://github.com/fmtlib/fmt/pull/453>
), made%.f
more conformant to regularprintf()
(#490 <https://github.com/fmtlib/fmt/pull/490>
), added custom writer support (#476 <https://github.com/fmtlib/fmt/issues/476>
) and implemented missing custom argument formatting (#339 <https://github.com/fmtlib/fmt/pull/339>
and#340 <https://github.com/fmtlib/fmt/pull/340>
_):
.. code:: c++
#include "fmt/printf.h" // %s format specifier can be used with any argument type. fmt::printf("%s", 42);
Thanks
@mojoBrendan <https://github.com/mojoBrendan>
,@manylegged (Arthur Danskin) <https://github.com/manylegged>
and@spacemoose (Glen Stark) <https://github.com/spacemoose>
. See also#360 <https://github.com/fmtlib/fmt/issues/360>
,#335 <https://github.com/fmtlib/fmt/issues/335>
_ and#331 <https://github.com/fmtlib/fmt/issues/331>
_.โ Added
container.h
containing aBasicContainerWriter
to write to containers likestd::vector
(#450 <https://github.com/fmtlib/fmt/pull/450>
). Thanks@polyvertex (Jean-Charles Lefebvre) <https://github.com/polyvertex>
.โ Added
fmt::join()
function that takes a range and formats its elements separated by a given string (#466 <https://github.com/fmtlib/fmt/pull/466>
_):
.. code:: c++
#include "fmt/format.h" std::vector<double> v = {1.2, 3.4, 5.6}; // Prints "(+01.20, +03.40, +05.60)". fmt::print("({:+06.2f})", fmt::join(v.begin(), v.end(), ", "));
Thanks
@olivier80 <https://github.com/olivier80>
_.โ Added support for custom formatting specifications to simplify customization of built-in formatting (
#444 <https://github.com/fmtlib/fmt/pull/444>
). Thanks@polyvertex (Jean-Charles Lefebvre) <https://github.com/polyvertex>
. See also#439 <https://github.com/fmtlib/fmt/issues/439>
_.Added
fmt::format_system_error()
for error code formatting (#323 <https://github.com/fmtlib/fmt/issues/323>
_ and#526 <https://github.com/fmtlib/fmt/pull/526>
). Thanks@maddinat0r (Alex Martin) <https://github.com/maddinat0r>
.โ Added thread-safe
fmt::localtime()
andfmt::gmtime()
as replacement for the standard version totime.h
(#396 <https://github.com/fmtlib/fmt/pull/396>
). Thanks@codicodi <https://github.com/codicodi>
.Internal improvements to
NamedArg
andArgLists
(#389 <https://github.com/fmtlib/fmt/pull/389>
_ and#390 <https://github.com/fmtlib/fmt/pull/390>
). Thanks@chronoxor <https://github.com/chronoxor>
.๐ Fixed crash due to bug in
FormatBuf
(#493 <https://github.com/fmtlib/fmt/pull/493>
). Thanks@effzeh <https://github.com/effzeh>
. See also#480 <https://github.com/fmtlib/fmt/issues/480>
_ and#491 <https://github.com/fmtlib/fmt/issues/491>
_.๐ Fixed handling of wide strings in
fmt::StringWriter
.๐ Improved compiler error messages (
#357 <https://github.com/fmtlib/fmt/issues/357>
_).๐ Fixed various warnings and issues with various compilers (
#494 <https://github.com/fmtlib/fmt/pull/494>
,#499 <https://github.com/fmtlib/fmt/pull/499>
,#483 <https://github.com/fmtlib/fmt/pull/483>
,#485 <https://github.com/fmtlib/fmt/pull/485>
,#482 <https://github.com/fmtlib/fmt/pull/482>
,#475 <https://github.com/fmtlib/fmt/pull/475>
,#473 <https://github.com/fmtlib/fmt/pull/473>
_ and#414 <https://github.com/fmtlib/fmt/pull/414>
). Thanks@chronoxor <https://github.com/chronoxor>
,@zhaohuaxishi <https://github.com/zhaohuaxishi>
,@pkestene (Pierre Kestener) <https://github.com/pkestene>
,@dschmidt (Dominik Schmidt) <https://github.com/dschmidt>
_ and@0x414c (Alexey Gorishny) <https://github.com/0x414c>
_ .๐ Improved CMake: targets are now namespaced (
#511 <https://github.com/fmtlib/fmt/pull/511>
_ and#513 <https://github.com/fmtlib/fmt/pull/513>
), supported header-onlyprintf.h
(#354 <https://github.com/fmtlib/fmt/pull/354>
), fixed issue with minimal supported library subset (#418 <https://github.com/fmtlib/fmt/issues/418>
,#419 <https://github.com/fmtlib/fmt/pull/419>
and#420 <https://github.com/fmtlib/fmt/pull/420>
). Thanks@bjoernthiel (Bjoern Thiel) <https://github.com/bjoernthiel>
,@niosHD (Mario Werner) <https://github.com/niosHD>
,@LogicalKnight (Sean LK) <https://github.com/LogicalKnight>
and@alabuzhev (Alex Alabuzhev) <https://github.com/alabuzhev>
_.๐ Improved documentation. Thanks to
@pwm1234 (Phil) <https://github.com/pwm1234>
_ for#393 <https://github.com/fmtlib/fmt/pull/393>
_.