All Versions
35
Latest Version
Avg Release Cycle
72 days
Latest Release
136 days ago

Changelog History
Page 2

  • v6.1.2

    December 11, 2019
    • ๐Ÿ›  Fixed ABI compatibility with libfmt.so.6.0.0 (#1471 <https://github.com/fmtlib/fmt/issues/1471>_).

    • ๐Ÿ›  Fixed handling types convertible to std::string_view (#1451 <https://github.com/fmtlib/fmt/pull/1451>). Thanks @denizevrenci (Deniz Evrenci) <https://github.com/denizevrenci>.

    • Made CUDA test an opt-in enabled via the FMT_CUDA_TEST CMake option.

    • ๐Ÿ›  Fixed sign conversion warnings (#1440 <https://github.com/fmtlib/fmt/pull/1440>). Thanks @0x8000-0000 (Florin Iucha) <https://github.com/0x8000-0000>.

  • v6.1.1

    December 04, 2019
    • ๐Ÿ›  Fixed shared library build on Windows (#1443 <https://github.com/fmtlib/fmt/pull/1443>, #1445 <https://github.com/fmtlib/fmt/issues/1445>, #1446 <https://github.com/fmtlib/fmt/pull/1446>, #1450 <https://github.com/fmtlib/fmt/issues/1450>). Thanks @egorpugin (Egor Pugin) <https://github.com/egorpugin>, @bbolli (Beat Bolli) <https://github.com/bbolli>.

    • โž• Added a missing decimal point in exponent notation with trailing zeros.

    • Removed deprecated format_arg_store::TYPES.

  • v6.1.0

    December 01, 2019
    • โœ… {fmt} now formats IEEE 754 float and double using the shortest decimal representation with correct rounding by default:

    .. code:: c++

     #include <cmath>
     #include <fmt/core.h>
    
     int main() {
       fmt::print("{}", M_PI);
     }
    

    prints 3.141592653589793.

    • 0๏ธโƒฃ Made the fast binary to decimal floating-point formatter the default, simplified it and improved performance. {fmt} is now 15 times faster than libc++'s std::ostringstream, 11 times faster than printf and 10% faster than double-conversion on dtoa-benchmark <https://github.com/fmtlib/dtoa-benchmark>_:

    ================== ========= ======= Function Time (ns) Speedup ================== ========= ======= ostringstream 1,346.30 1.00x ostrstream 1,195.74 1.13x sprintf 995.08 1.35x doubleconv 99.10 13.59x fmt 88.34 15.24x ================== ========= =======

    .. image:: https://user-images.githubusercontent.com/576385/ 69767160-cdaca400-112f-11ea-9fc5-347c9f83caad.png

    • {fmt} no longer converts float arguments to double. In particular this improves the default (shortest) representation of floats and makes fmt::format consistent with std::format specs (#1336 <https://github.com/fmtlib/fmt/issues/1336>, #1353 <https://github.com/fmtlib/fmt/issues/1353>, #1360 <https://github.com/fmtlib/fmt/pull/1360>, #1361 <https://github.com/fmtlib/fmt/pull/1361>):

    .. code:: c++

     fmt::print("{}", 0.1f);
    

    prints 0.1 instead of 0.10000000149011612.

    Thanks @orivej (Orivej Desh) <https://github.com/orivej>_.

    • ๐Ÿ–จ Made floating-point formatting output consistent with printf/iostreams (#1376 <https://github.com/fmtlib/fmt/issues/1376>, #1417 <https://github.com/fmtlib/fmt/issues/1417>).

    • โž• Added support for 128-bit integers (#1287 <https://github.com/fmtlib/fmt/pull/1287>_):

    .. code:: c++

     fmt::print("{}", std::numeric_limits<__int128_t>::max());
    

    prints 170141183460469231731687303715884105727.

    Thanks @denizevrenci (Deniz Evrenci) <https://github.com/denizevrenci>_.

    • ๐Ÿ’… The overload of print that takes text_style is now atomic, i.e. the output from different threads doesn't interleave (#1351 <https://github.com/fmtlib/fmt/pull/1351>). Thanks @tankiJong (Tanki Zhang) <https://github.com/tankiJong>.

    • Made compile time in the header-only mode ~20% faster by reducing the number of template instantiations. wchar_t overload of vprint was moved from fmt/core.h to fmt/format.h.

    • โž• Added an overload of fmt::join that works with tuples (#1322 <https://github.com/fmtlib/fmt/issues/1322>, #1330 <https://github.com/fmtlib/fmt/pull/1330>):

    .. code:: c++

     #include <tuple>
     #include <fmt/ranges.h>
    
     int main() {
       std::tuple<char, int, float> t{'a', 1, 2.0f};
       fmt::print("{}", t);
     }
    

    prints ('a', 1, 2.0).

    Thanks @jeremyong (Jeremy Ong) <https://github.com/jeremyong>_.

    • ๐Ÿ”„ Changed formatting of octal zero with prefix from "00" to "0":

    .. code:: c++

     fmt::print("{:#o}", 0);
    

    prints 0.

    • The locale is now passed to ostream insertion (<<) operators (#1406 <https://github.com/fmtlib/fmt/pull/1406>_):

    .. code:: c++

     #include <fmt/locale.h>
     #include <fmt/ostream.h>
    
     struct S {
       double value;
     };
    
     std::ostream& operator<<(std::ostream& os, S s) {
       return os << s.value;
     }
    
     int main() {
       auto s = fmt::format(std::locale("fr_FR.UTF-8"), "{}", S{0.42});
       // s == "0,42"
     }
    

    Thanks @dlaugt (Daniel Laรผgt) <https://github.com/dlaugt>_.

    • Locale-specific number formatting now uses grouping (#1393 <https://github.com/fmtlib/fmt/issues/1393>_ #1394 <https://github.com/fmtlib/fmt/pull/1394>). Thanks @skrdaniel <https://github.com/skrdaniel>.

    • ๐Ÿ›  Fixed handling of types with deleted implicit rvalue conversion to const char** (#1421 <https://github.com/fmtlib/fmt/issues/1421>_):

    .. code:: c++

     struct mystring {
       operator const char*() const&;
       operator const char*() &;
       operator const char*() const&& = delete;
       operator const char*() && = delete;
     };
     mystring str;
     fmt::print("{}", str); // now compiles
    
    • Enums are now mapped to correct underlying types instead of int (#1286 <https://github.com/fmtlib/fmt/pull/1286>). Thanks @agmt (Egor Seredin) <https://github.com/agmt>.

    • Enum classes are no longer implicitly converted to int (#1424 <https://github.com/fmtlib/fmt/issues/1424>_).

    • Added basic_format_parse_context for consistency with C++20 std::format and deprecated basic_parse_context.

    • ๐Ÿ›  Fixed handling of UTF-8 in precision (#1389 <https://github.com/fmtlib/fmt/issues/1389>, #1390 <https://github.com/fmtlib/fmt/pull/1390>). Thanks @tajtiattila (Attila Tajti) <https://github.com/tajtiattila>_.

    • ๐ŸŽ {fmt} can now be installed on Linux, macOS and Windows with Conda <https://docs.conda.io/en/latest/>__ using its conda-forge <https://conda-forge.org>__ package <https://github.com/conda-forge/fmt-feedstock>__ (#1410 <https://github.com/fmtlib/fmt/pull/1410>_)::

      conda install -c conda-forge fmt

    Thanks @tdegeus (Tom de Geus) <https://github.com/tdegeus>_.

    • โž• Added a CUDA test (#1285 <https://github.com/fmtlib/fmt/pull/1285>, #1317 <https://github.com/fmtlib/fmt/pull/1317>). Thanks @luncliff (Park DongHa) <https://github.com/luncliff>_ and @risa2000 <https://github.com/risa2000>_.

    • ๐Ÿ‘Œ Improved documentation (#1276 <https://github.com/fmtlib/fmt/pull/1276>, #1291 <https://github.com/fmtlib/fmt/issues/1291>, #1296 <https://github.com/fmtlib/fmt/issues/1296>, #1315 <https://github.com/fmtlib/fmt/pull/1315>, #1332 <https://github.com/fmtlib/fmt/pull/1332>, #1337 <https://github.com/fmtlib/fmt/pull/1337>, #1395 <https://github.com/fmtlib/fmt/issues/1395>_ #1418 <https://github.com/fmtlib/fmt/pull/1418>). Thanks @waywardmonkeys (Bruce Mitchener) <https://github.com/waywardmonkeys>, @pauldreik (Paul Dreik) <https://github.com/pauldreik>, @jackoalan (Jack Andersen) <https://github.com/jackoalan>.

    • Various code improvements (#1358 <https://github.com/fmtlib/fmt/pull/1358>, #1407 <https://github.com/fmtlib/fmt/pull/1407>). Thanks @orivej (Orivej Desh) <https://github.com/orivej>, @dpacbach (David P. Sicilia) <https://github.com/dpacbach>,

    • ๐Ÿ›  Fixed compile-time format string checks for user-defined types (#1292 <https://github.com/fmtlib/fmt/issues/1292>_).

    • Worked around a false positive in unsigned-integer-overflow sanitizer (#1377 <https://github.com/fmtlib/fmt/issues/1377>_).

    • ๐Ÿ›  Fixed various warnings and compilation issues (#1273 <https://github.com/fmtlib/fmt/issues/1273>, #1278 <https://github.com/fmtlib/fmt/pull/1278>, #1280 <https://github.com/fmtlib/fmt/pull/1280>, #1281 <https://github.com/fmtlib/fmt/issues/1281>, #1288 <https://github.com/fmtlib/fmt/issues/1288>, #1290 <https://github.com/fmtlib/fmt/pull/1290>, #1301 <https://github.com/fmtlib/fmt/pull/1301>, #1305 <https://github.com/fmtlib/fmt/issues/1305>, #1306 <https://github.com/fmtlib/fmt/issues/1306>, #1309 <https://github.com/fmtlib/fmt/issues/1309>, #1312 <https://github.com/fmtlib/fmt/pull/1312>, #1313 <https://github.com/fmtlib/fmt/issues/1313>, #1316 <https://github.com/fmtlib/fmt/issues/1316>, #1319 <https://github.com/fmtlib/fmt/issues/1319>, #1320 <https://github.com/fmtlib/fmt/pull/1320>, #1326 <https://github.com/fmtlib/fmt/pull/1326>, #1328 <https://github.com/fmtlib/fmt/pull/1328>, #1344 <https://github.com/fmtlib/fmt/issues/1344>, #1345 <https://github.com/fmtlib/fmt/pull/1345>, #1347 <https://github.com/fmtlib/fmt/pull/1347>, #1349 <https://github.com/fmtlib/fmt/pull/1349>, #1354 <https://github.com/fmtlib/fmt/issues/1354>, #1362 <https://github.com/fmtlib/fmt/issues/1362>, #1366 <https://github.com/fmtlib/fmt/issues/1366>, #1364 <https://github.com/fmtlib/fmt/pull/1364>, #1370 <https://github.com/fmtlib/fmt/pull/1370>, #1371 <https://github.com/fmtlib/fmt/pull/1371>, #1385 <https://github.com/fmtlib/fmt/issues/1385>, #1388 <https://github.com/fmtlib/fmt/issues/1388>, #1397 <https://github.com/fmtlib/fmt/pull/1397>, #1414 <https://github.com/fmtlib/fmt/pull/1414>, #1416 <https://github.com/fmtlib/fmt/pull/1416>, #1422 <https://github.com/fmtlib/fmt/issues/1422>_ #1427 <https://github.com/fmtlib/fmt/pull/1427>, #1431 <https://github.com/fmtlib/fmt/issues/1431>, #1433 <https://github.com/fmtlib/fmt/pull/1433>). Thanks @hhb <https://github.com/hhb>, @gsjaardema (Greg Sjaardema) <https://github.com/gsjaardema>, @gabime (Gabi Melman) <https://github.com/gabime>, @neheb (Rosen Penev) <https://github.com/neheb>, @vedranmiletic (Vedran Miletiฤ‡) <https://github.com/vedranmiletic>, @dkavolis (Daumantas Kavolis) <https://github.com/dkavolis>, @mwinterb <https://github.com/mwinterb>, @orivej (Orivej Desh) <https://github.com/orivej>, @denizevrenci (Deniz Evrenci) <https://github.com/denizevrenci> @leonklingele <https://github.com/leonklingele>, @chronoxor (Ivan Shynkarenka) <https://github.com/chronoxor>, @kent-tri <https://github.com/kent-tri>, @0x8000-0000 (Florin Iucha) <https://github.com/0x8000-0000>, @marti4d (Chris Martin) <https://github.com/marti4d>_.

  • v6.0.0

    August 26, 2019
    • Switched to the MIT license <https://github.com/fmtlib/fmt/blob/5a4b24613ba16cc689977c3b5bd8274a3ba1dd1f/LICENSE.rst>_ with an optional exception that allows distributing binary code without attribution.

    • 0๏ธโƒฃ Floating-point formatting is now locale-independent by default:

    .. code:: c++

     #include <locale>
     #include <fmt/core.h>
    
     int main() {
       std::locale::global(std::locale("ru_RU.UTF-8"));
       fmt::print("value = {}", 4.2);
     }
    

    prints "value = 4.2" regardless of the locale.

    For locale-specific formatting use the n specifier:

    .. code:: c++

     std::locale::global(std::locale("ru_RU.UTF-8"));
     fmt::print("value = {:n}", 4.2);
    

    prints "value = 4,2".

    • โž• Added an experimental Grisu floating-point formatting algorithm implementation (disabled by default). To enable it compile with the FMT_USE_GRISU macro defined to 1:

    .. code:: c++

     #define FMT_USE_GRISU 1
     #include <fmt/format.h>
    
     auto s = fmt::format("{}", 4.2); // formats 4.2 using Grisu
    

    With Grisu enabled, {fmt} is 13x faster than std::ostringstream (libc++) and 10x faster than sprintf on dtoa-benchmark <https://github.com/fmtlib/dtoa-benchmark>_ (full results <https://fmt.dev/unknown_mac64_clang10.0.html>_):

    .. image:: https://user-images.githubusercontent.com/576385/ 54883977-9fe8c000-4e28-11e9-8bde-272d122e7c52.jpg

    • ๐Ÿ“œ Separated formatting and parsing contexts for consistency with C++20 std::format <http://eel.is/c++draft/format>_, removing the undocumented basic_format_context::parse_context() function.

    • โž• Added oss-fuzz <https://github.com/google/oss-fuzz>_ support (#1199 <https://github.com/fmtlib/fmt/pull/1199>). Thanks @pauldreik (Paul Dreik) <https://github.com/pauldreik>.

    • formatter specializations now always take precedence over operator<< (#952 <https://github.com/fmtlib/fmt/issues/952>_):

    .. code:: c++

     #include <iostream>
     #include <fmt/ostream.h>
    
     struct S {};
    
     std::ostream& operator<<(std::ostream& os, S) {
       return os << 1;
     }
    
     template <>
     struct fmt::formatter<S> : fmt::formatter<int> {
       auto format(S, format_context& ctx) {
         return formatter<int>::format(2, ctx);
       }
     };
    
     int main() {
       std::cout << S() << "\n"; // prints 1 using operator<<
       fmt::print("{}\n", S());  // prints 2 using formatter
     }
    
    • Introduced the experimental fmt::compile function that does format string compilation (#618 <https://github.com/fmtlib/fmt/issues/618>, #1169 <https://github.com/fmtlib/fmt/issues/1169>, #1171 <https://github.com/fmtlib/fmt/pull/1171>_):

    .. code:: c++

     #include <fmt/compile.h>
    
     auto f = fmt::compile<int>("{}");
     std::string s = fmt::format(f, 42); // can be called multiple times to
                                         // format different values
     // s == "42"
    

    It moves the cost of parsing a format string outside of the format function which can be beneficial when identically formatting many objects of the same types. Thanks @stryku (Mateusz Janek) <https://github.com/stryku>_.

    • โž• Added experimental % format specifier that formats floating-point values as percentages (#1060 <https://github.com/fmtlib/fmt/pull/1060>, #1069 <https://github.com/fmtlib/fmt/pull/1069>, #1071 <https://github.com/fmtlib/fmt/pull/1071>_):

    .. code:: c++

     auto s = fmt::format("{:.1%}", 0.42); // s == "42.0%"
    

    Thanks @gawain-bolton (Gawain Bolton) <https://github.com/gawain-bolton>_.

    • Implemented precision for floating-point durations (#1004 <https://github.com/fmtlib/fmt/issues/1004>, #1012 <https://github.com/fmtlib/fmt/pull/1012>):

    .. code:: c++

     auto s = fmt::format("{:.1}", std::chrono::duration<double>(1.234));
     // s == 1.2s
    

    Thanks @DanielaE (Daniela Engert) <https://github.com/DanielaE>_.

    • Implemented chrono format specifiers %Q and %q that give the value and the unit respectively (#1019 <https://github.com/fmtlib/fmt/pull/1019>_):

    .. code:: c++

     auto value = fmt::format("{:%Q}", 42s); // value == "42"
     auto unit  = fmt::format("{:%q}", 42s); // unit == "s"
    

    Thanks @DanielaE (Daniela Engert) <https://github.com/DanielaE>_.

    • ๐Ÿ›  Fixed handling of dynamic width in chrono formatter:

    .. code:: c++

     auto s = fmt::format("{0:{1}%H:%M:%S}", std::chrono::seconds(12345), 12);
     //                        ^ width argument index                     ^ width
     // s == "03:25:45    "
    

    Thanks Howard Hinnant.

    • โœ‚ Removed deprecated fmt/time.h. Use fmt/chrono.h instead.

    • โž• Added fmt::format and fmt::vformat overloads that take text_style (#993 <https://github.com/fmtlib/fmt/issues/993>, #994 <https://github.com/fmtlib/fmt/pull/994>):

    .. code:: c++

     #include <fmt/color.h>
    
     std::string message = fmt::format(fmt::emphasis::bold | fg(fmt::color::red),
                                       "The answer is {}.", 42);
    

    Thanks @Naios (Denis Blank) <https://github.com/Naios>_.

    • โœ‚ Removed the deprecated color API (print_colored). Use the new API, namely print overloads that take text_style instead.

    • Made std::unique_ptr and std::shared_ptr formattable as pointers via fmt::ptr (#1121 <https://github.com/fmtlib/fmt/pull/1121>_):

    .. code:: c++

     std::unique_ptr<int> p = ...;
     fmt::print("{}", fmt::ptr(p)); // prints p as a pointer
    

    Thanks @sighingnow (Tao He) <https://github.com/sighingnow>_.

    • ๐Ÿ–จ Made print and vprint report I/O errors (#1098 <https://github.com/fmtlib/fmt/issues/1098>, #1099 <https://github.com/fmtlib/fmt/pull/1099>). Thanks @BillyDonahue (Billy Donahue) <https://github.com/BillyDonahue>_.

    • ๐Ÿšš Marked deprecated APIs with the [[deprecated]] attribute and removed internal uses of deprecated APIs (#1022 <https://github.com/fmtlib/fmt/pull/1022>). Thanks @eliaskosunen (Elias Kosunen) <https://github.com/eliaskosunen>.

    • โ†ช Modernized the codebase using more C++11 features and removing workarounds. Most importantly, buffer_context is now an alias template, so use buffer_context<T> instead of buffer_context<T>::type. These features require GCC 4.8 or later.

    • formatter specializations now always take precedence over implicit conversions to int and the undocumented convert_to_int trait is now deprecated.

    • ๐Ÿšš Moved the undocumented basic_writer, writer, and wwriter types to the internal namespace.

    • Removed deprecated basic_format_context::begin(). Use out() instead.

    • Disallowed passing the result of join as an lvalue to prevent misuse.

    • โ™ป๏ธ Refactored the undocumented structs that represent parsed format specifiers to simplify the API and allow multibyte fill.

    • ๐Ÿšš Moved SFINAE to template parameters to reduce symbol sizes.

    • Switched to fputws for writing wide strings so that it's no longer required to call _setmode on Windows (#1229 <https://github.com/fmtlib/fmt/issues/1229>, #1243 <https://github.com/fmtlib/fmt/pull/1243>). Thanks @jackoalan (Jack Andersen) <https://github.com/jackoalan>_.

    • ๐Ÿ‘Œ Improved literal-based API (#1254 <https://github.com/fmtlib/fmt/pull/1254>). Thanks @sylveon (Charles Milette) <https://github.com/sylveon>.

    • โž• Added support for exotic platforms without uintptr_t such as IBM i (AS/400) which has 128-bit pointers and only 64-bit integers (#1059 <https://github.com/fmtlib/fmt/issues/1059>_).

    • โž• Added Sublime Text syntax highlighting config <https://github.com/fmtlib/fmt/blob/master/support/C%2B%2B.sublime-syntax>_ (#1037 <https://github.com/fmtlib/fmt/issues/1037>). Thanks @Kronuz (Germรกn Mรฉndez Bravo) <https://github.com/Kronuz>.

    • Added the FMT_ENFORCE_COMPILE_STRING macro to enforce the use of compile-time format strings (#1231 <https://github.com/fmtlib/fmt/pull/1231>). Thanks @jackoalan (Jack Andersen) <https://github.com/jackoalan>.

    • ๐Ÿ— Stopped setting CMAKE_BUILD_TYPE if {fmt} is a subproject (#1081 <https://github.com/fmtlib/fmt/issues/1081>_).

    • ๐Ÿ— Various build improvements (#1039 <https://github.com/fmtlib/fmt/pull/1039>, #1078 <https://github.com/fmtlib/fmt/pull/1078>, #1091 <https://github.com/fmtlib/fmt/pull/1091>, #1103 <https://github.com/fmtlib/fmt/pull/1103>, #1177 <https://github.com/fmtlib/fmt/pull/1177>). Thanks @luncliff (Park DongHa) <https://github.com/luncliff>, @jasonszang (Jason Shuo Zang) <https://github.com/jasonszang>, @olafhering (Olaf Hering) <https://github.com/olafhering>, @Lecetem <https://github.com/Lectem>, @pauldreik (Paul Dreik) <https://github.com/pauldreik>.

    • ๐Ÿ‘Œ Improved documentation (#1049 <https://github.com/fmtlib/fmt/issues/1049>, #1051 <https://github.com/fmtlib/fmt/pull/1051>, #1083 <https://github.com/fmtlib/fmt/pull/1083>, #1113 <https://github.com/fmtlib/fmt/pull/1113>, #1114 <https://github.com/fmtlib/fmt/pull/1114>, #1146 <https://github.com/fmtlib/fmt/issues/1146>, #1180 <https://github.com/fmtlib/fmt/issues/1180>, #1250 <https://github.com/fmtlib/fmt/pull/1250>, #1252 <https://github.com/fmtlib/fmt/pull/1252>, #1265 <https://github.com/fmtlib/fmt/pull/1265>). Thanks @mikelui (Michael Lui) <https://github.com/mikelui>, @foonathan (Jonathan Mรผller) <https://github.com/foonathan>, @BillyDonahue (Billy Donahue) <https://github.com/BillyDonahue>, @jwakely (Jonathan Wakely) <https://github.com/jwakely>, @kaisbe (Kais Ben Salah) <https://github.com/kaisbe>, @sdebionne (Samuel Debionne) <https://github.com/sdebionne>.

    • ๐Ÿ›  Fixed ambiguous formatter specialization in fmt/ranges.h (#1123 <https://github.com/fmtlib/fmt/issues/1123>_).

    • ๐Ÿ›  Fixed formatting of a non-empty std::filesystem::path which is an infinitely deep range of its components (#1268 <https://github.com/fmtlib/fmt/issues/1268>_).

    • ๐Ÿ›  Fixed handling of general output iterators when formatting characters (#1056 <https://github.com/fmtlib/fmt/issues/1056>, #1058 <https://github.com/fmtlib/fmt/pull/1058>). Thanks @abolz (Alexander Bolz) <https://github.com/abolz>_.

    • ๐Ÿ›  Fixed handling of output iterators in formatter specialization for ranges (#1064 <https://github.com/fmtlib/fmt/issues/1064>_).

    • ๐Ÿ›  Fixed handling of exotic character types (#1188 <https://github.com/fmtlib/fmt/issues/1188>_).

    • Made chrono formatting work with exceptions disabled (#1062 <https://github.com/fmtlib/fmt/issues/1062>_).

    • ๐Ÿ›  Fixed DLL visibility issues (#1134 <https://github.com/fmtlib/fmt/pull/1134>, #1147 <https://github.com/fmtlib/fmt/pull/1147>). Thanks @denchat <https://github.com/denchat>_.

    • Disabled the use of UDL template extension on GCC 9 (#1148 <https://github.com/fmtlib/fmt/issues/1148>_).

    • โœ‚ Removed misplaced format compile-time checks from printf (#1173 <https://github.com/fmtlib/fmt/issues/1173>_).

    • ๐Ÿ›  Fixed issues in the experimental floating-point formatter (#1072 <https://github.com/fmtlib/fmt/issues/1072>, #1129 <https://github.com/fmtlib/fmt/issues/1129>, #1153 <https://github.com/fmtlib/fmt/issues/1153>, #1155 <https://github.com/fmtlib/fmt/pull/1155>, #1210 <https://github.com/fmtlib/fmt/issues/1210>, #1222 <https://github.com/fmtlib/fmt/issues/1222>). Thanks @alabuzhev (Alex Alabuzhev) <https://github.com/alabuzhev>_.

    • ๐Ÿ›  Fixed bugs discovered by fuzzing or during fuzzing integration (#1124 <https://github.com/fmtlib/fmt/issues/1124>, #1127 <https://github.com/fmtlib/fmt/issues/1127>, #1132 <https://github.com/fmtlib/fmt/issues/1132>, #1135 <https://github.com/fmtlib/fmt/pull/1135>, #1136 <https://github.com/fmtlib/fmt/issues/1136>, #1141 <https://github.com/fmtlib/fmt/issues/1141>, #1142 <https://github.com/fmtlib/fmt/issues/1142>, #1178 <https://github.com/fmtlib/fmt/issues/1178>, #1179 <https://github.com/fmtlib/fmt/issues/1179>, #1194 <https://github.com/fmtlib/fmt/issues/1194>). Thanks @pauldreik (Paul Dreik) <https://github.com/pauldreik>_.

    • ๐Ÿ›  Fixed building tests on FreeBSD and Hurd (#1043 <https://github.com/fmtlib/fmt/issues/1043>). Thanks @jackyf (Eugene V. Lyubimkin) <https://github.com/jackyf>.

    • ๐Ÿ›  Fixed various warnings and compilation issues (#998 <https://github.com/fmtlib/fmt/pull/998>, #1006 <https://github.com/fmtlib/fmt/pull/1006>, #1008 <https://github.com/fmtlib/fmt/issues/1008>, #1011 <https://github.com/fmtlib/fmt/issues/1011>, #1025 <https://github.com/fmtlib/fmt/issues/1025>, #1027 <https://github.com/fmtlib/fmt/pull/1027>, #1028 <https://github.com/fmtlib/fmt/pull/1028>, #1029 <https://github.com/fmtlib/fmt/pull/1029>, #1030 <https://github.com/fmtlib/fmt/pull/1030>, #1031 <https://github.com/fmtlib/fmt/pull/1031>, #1054 <https://github.com/fmtlib/fmt/pull/1054>, #1063 <https://github.com/fmtlib/fmt/issues/1063>, #1068 <https://github.com/fmtlib/fmt/pull/1068>, #1074 <https://github.com/fmtlib/fmt/pull/1074>, #1075 <https://github.com/fmtlib/fmt/pull/1075>, #1079 <https://github.com/fmtlib/fmt/pull/1079>, #1086 <https://github.com/fmtlib/fmt/pull/1086>, #1088 <https://github.com/fmtlib/fmt/issues/1088>, #1089 <https://github.com/fmtlib/fmt/pull/1089>, #1094 <https://github.com/fmtlib/fmt/pull/1094>, #1101 <https://github.com/fmtlib/fmt/issues/1101>, #1102 <https://github.com/fmtlib/fmt/pull/1102>, #1105 <https://github.com/fmtlib/fmt/issues/1105>, #1107 <https://github.com/fmtlib/fmt/pull/1107>, #1115 <https://github.com/fmtlib/fmt/issues/1115>, #1117 <https://github.com/fmtlib/fmt/issues/1117>, #1118 <https://github.com/fmtlib/fmt/issues/1118>, #1120 <https://github.com/fmtlib/fmt/issues/1120>, #1123 <https://github.com/fmtlib/fmt/issues/1123>, #1139 <https://github.com/fmtlib/fmt/pull/1139>, #1140 <https://github.com/fmtlib/fmt/issues/1140>, #1143 <https://github.com/fmtlib/fmt/issues/1143>, #1144 <https://github.com/fmtlib/fmt/pull/1144>, #1150 <https://github.com/fmtlib/fmt/pull/1150>, #1151 <https://github.com/fmtlib/fmt/pull/1151>, #1152 <https://github.com/fmtlib/fmt/issues/1152>, #1154 <https://github.com/fmtlib/fmt/issues/1154>, #1156 <https://github.com/fmtlib/fmt/issues/1156>, #1159 <https://github.com/fmtlib/fmt/pull/1159>, #1175 <https://github.com/fmtlib/fmt/issues/1175>, #1181 <https://github.com/fmtlib/fmt/issues/1181>, #1186 <https://github.com/fmtlib/fmt/issues/1186>, #1187 <https://github.com/fmtlib/fmt/pull/1187>, #1191 <https://github.com/fmtlib/fmt/pull/1191>, #1197 <https://github.com/fmtlib/fmt/issues/1197>, #1200 <https://github.com/fmtlib/fmt/issues/1200>, #1203 <https://github.com/fmtlib/fmt/issues/1203>, #1205 <https://github.com/fmtlib/fmt/issues/1205>, #1206 <https://github.com/fmtlib/fmt/pull/1206>, #1213 <https://github.com/fmtlib/fmt/issues/1213>, #1214 <https://github.com/fmtlib/fmt/issues/1214>, #1217 <https://github.com/fmtlib/fmt/pull/1217>, #1228 <https://github.com/fmtlib/fmt/issues/1228>, #1230 <https://github.com/fmtlib/fmt/pull/1230>, #1232 <https://github.com/fmtlib/fmt/issues/1232>, #1235 <https://github.com/fmtlib/fmt/pull/1235>, #1236 <https://github.com/fmtlib/fmt/pull/1236>, #1240 <https://github.com/fmtlib/fmt/issues/1240>). Thanks @DanielaE (Daniela Engert) <https://github.com/DanielaE>, @mwinterb <https://github.com/mwinterb>, @eliaskosunen (Elias Kosunen) <https://github.com/eliaskosunen>, @morinmorin <https://github.com/morinmorin>, @ricco19 (Brian Ricciardelli) <https://github.com/ricco19>, @waywardmonkeys (Bruce Mitchener) <https://github.com/waywardmonkeys>, @chronoxor (Ivan Shynkarenka) <https://github.com/chronoxor>, @remyabel <https://github.com/remyabel>, @pauldreik (Paul Dreik) <https://github.com/pauldreik>, @gsjaardema (Greg Sjaardema) <https://github.com/gsjaardema>, @rcane (Ronny Krรผger) <https://github.com/rcane>, @mocabe <https://github.com/mocabe>, @denchat <https://github.com/denchat>, @cjdb (Christopher Di Bella) <https://github.com/cjdb>, @HazardyKnusperkeks (Bjรถrn Schรคpers) <https://github.com/HazardyKnusperkeks>, @vedranmiletic (Vedran Miletiฤ‡) <https://github.com/vedranmiletic>, @jackoalan (Jack Andersen) <https://github.com/jackoalan>, @DaanDeMeyer (Daan De Meyer) <https://github.com/DaanDeMeyer>, @starkmapper (Mark Stapper) <https://github.com/starkmapper>_.

  • v5.3.0

    December 28, 2018
    • ๐Ÿ‘ Introduced experimental chrono formatting support:

    .. code:: c++

     #include <fmt/chrono.h>
    
     int main() {
       using namespace std::literals::chrono_literals;
       fmt::print("Default format: {} {}\n", 42s, 100ms);
       fmt::print("strftime-like format: {:%H:%M:%S}\n", 3h + 15min + 30s);
     }
    

    prints::

     Default format: 42s 100ms
     strftime-like format: 03:15:30
    
    • โž• Added experimental support for emphasis (bold, italic, underline, strikethrough), colored output to a file stream, and improved colored formatting API (#961 <https://github.com/fmtlib/fmt/pull/961>, #967 <https://github.com/fmtlib/fmt/pull/967>, #973 <https://github.com/fmtlib/fmt/pull/973>_):

    .. code:: c++

     #include <fmt/color.h>
    
     int main() {
       print(fg(fmt::color::crimson) | fmt::emphasis::bold,
             "Hello, {}!\n", "world");
       print(fg(fmt::color::floral_white) | bg(fmt::color::slate_gray) |
             fmt::emphasis::underline, "Hello, {}!\n", "ะผะธั€");
       print(fg(fmt::color::steel_blue) | fmt::emphasis::italic,
             "Hello, {}!\n", "ไธ–็•Œ");
     }
    

    prints the following on modern terminals with RGB color support:

    .. image:: https://user-images.githubusercontent.com/576385/ 50405788-b66e7500-076e-11e9-9592-7324d1f951d8.png

    Thanks @Rakete1111 (Nicolas) <https://github.com/Rakete1111>_.

    • โž• Added support for 4-bit terminal colors (#968 <https://github.com/fmtlib/fmt/issues/968>, #974 <https://github.com/fmtlib/fmt/pull/974>)

    .. code:: c++

     #include <fmt/color.h>
    
     int main() {
       print(fg(fmt::terminal_color::red), "stop\n");
     }
    

    Note that these colors vary by terminal:

    .. image:: https://user-images.githubusercontent.com/576385/ 50405925-dbfc7e00-0770-11e9-9b85-333fab0af9ac.png

    Thanks @Rakete1111 (Nicolas) <https://github.com/Rakete1111>_.

    • Parameterized formatting functions on the type of the format string (#880 <https://github.com/fmtlib/fmt/issues/880>, #881 <https://github.com/fmtlib/fmt/pull/881>, #883 <https://github.com/fmtlib/fmt/pull/883>, #885 <https://github.com/fmtlib/fmt/pull/885>, #897 <https://github.com/fmtlib/fmt/pull/897>, #920 <https://github.com/fmtlib/fmt/issues/920>). Any object of type S that has an overloaded to_string_view(const S&) returning fmt::string_view can be used as a format string:

    .. code:: c++

     namespace my_ns {
     inline string_view to_string_view(const my_string& s) {
       return {s.data(), s.length()};
     }
     }
    
     std::string message = fmt::format(my_string("The answer is {}."), 42);
    

    Thanks @DanielaE (Daniela Engert) <https://github.com/DanielaE>_.

    • Made std::string_view work as a format string (#898 <https://github.com/fmtlib/fmt/pull/898>_):

    .. code:: c++

     auto message = fmt::format(std::string_view("The answer is {}."), 42);
    

    Thanks @DanielaE (Daniela Engert) <https://github.com/DanielaE>_.

    • โž• Added wide string support to compile-time format string checks (#924 <https://github.com/fmtlib/fmt/pull/924>_):

    .. code:: c++

     print(fmt(L"{:f}"), 42); // compile-time error: invalid type specifier
    

    Thanks @XZiar <https://github.com/XZiar>_.

    • ๐Ÿ–จ Made colored print functions work with wide strings (#867 <https://github.com/fmtlib/fmt/pull/867>_):

    .. code:: c++

     #include <fmt/color.h>
    
     int main() {
       print(fg(fmt::color::red), L"{}\n", 42);
     }
    

    Thanks @DanielaE (Daniela Engert) <https://github.com/DanielaE>_.

    • ๐Ÿ‘ Introduced experimental Unicode support (#628 <https://github.com/fmtlib/fmt/issues/628>, #891 <https://github.com/fmtlib/fmt/pull/891>):

    .. code:: c++

     using namespace fmt::literals;
     auto s = fmt::format("{:*^5}"_u, "๐Ÿคก"_u); // s == "**๐Ÿคก**"_u
    
    • ๐Ÿ‘Œ Improved locale support:

    .. code:: c++

     #include <fmt/locale.h>
    
     struct numpunct : std::numpunct<char> {
      protected:
       char do_thousands_sep() const override { return '~'; }
     };
    
     std::locale loc;
     auto s = fmt::format(std::locale(loc, new numpunct()), "{:n}", 1234567);
     // s == "1~234~567"
    
    • Constrained formatting functions on proper iterator types (#921 <https://github.com/fmtlib/fmt/pull/921>). Thanks @DanielaE (Daniela Engert) <https://github.com/DanielaE>.

    • ๐Ÿ–จ Added make_printf_args and make_wprintf_args functions (#934 <https://github.com/fmtlib/fmt/pull/934>). Thanks @tnovotny <https://github.com/tnovotny>.

    • ๐Ÿ“œ Deprecated fmt::visit, parse_context, and wparse_context. Use fmt::visit_format_arg, format_parse_context, and wformat_parse_context instead.

    • ๐Ÿ›  Removed undocumented basic_fixed_buffer which has been superseded by the iterator-based API (#873 <https://github.com/fmtlib/fmt/issues/873>, #902 <https://github.com/fmtlib/fmt/pull/902>). Thanks @superfunc (hollywood programmer) <https://github.com/superfunc>_.

    • Disallowed repeated leading zeros in an argument ID:

    .. code:: c++

     fmt::print("{000}", 42); // error
    
    • ๐Ÿ‘ Reintroduced support for gcc 4.4.

    • ๐Ÿ›  Fixed compilation on platforms with exotic double (#878 <https://github.com/fmtlib/fmt/issues/878>_).

    • ๐Ÿ‘Œ Improved documentation (#164 <https://github.com/fmtlib/fmt/issues/164>, #877 <https://github.com/fmtlib/fmt/issues/877>, #901 <https://github.com/fmtlib/fmt/pull/901>, #906 <https://github.com/fmtlib/fmt/pull/906>, #979 <https://github.com/fmtlib/fmt/pull/979>). Thanks @kookjr (Mathew Cucuzella) <https://github.com/kookjr>, @DarkDimius (Dmitry Petrashko) <https://github.com/DarkDimius>, @HecticSerenity <https://github.com/HecticSerenity>.

    • โž• Added pkgconfig support which makes it easier to consume the library from meson and other build systems (#916 <https://github.com/fmtlib/fmt/pull/916>). Thanks @colemickens (Cole Mickens) <https://github.com/colemickens>.

    • ๐Ÿ— Various build improvements (#909 <https://github.com/fmtlib/fmt/pull/909>, #926 <https://github.com/fmtlib/fmt/pull/926>, #937 <https://github.com/fmtlib/fmt/pull/937>, #953 <https://github.com/fmtlib/fmt/pull/953>, #959 <https://github.com/fmtlib/fmt/pull/959>). Thanks @tchaikov (Kefu Chai) <https://github.com/tchaikov>, @luncliff (Park DongHa) <https://github.com/luncliff>, @AndreasSchoenle (Andreas Schรถnle) <https://github.com/AndreasSchoenle>, @hotwatermorning <https://github.com/hotwatermorning>, @Zefz (JohanJansen) <https://github.com/Zefz>.

    • ๐Ÿ‘Œ Improved string_view construction performance (#914 <https://github.com/fmtlib/fmt/pull/914>). Thanks @gabime (Gabi Melman) <https://github.com/gabime>.

    • ๐Ÿ›  Fixed non-matching char types (#895 <https://github.com/fmtlib/fmt/pull/895>). Thanks @DanielaE (Daniela Engert) <https://github.com/DanielaE>.

    • Fixed format_to_n with std::back_insert_iterator (#913 <https://github.com/fmtlib/fmt/pull/913>). Thanks @DanielaE (Daniela Engert) <https://github.com/DanielaE>.

    • ๐Ÿ›  Fixed locale-dependent formatting (#905 <https://github.com/fmtlib/fmt/issues/905>_).

    • ๐Ÿ›  Fixed various compiler warnings and errors (#882 <https://github.com/fmtlib/fmt/pull/882>, #886 <https://github.com/fmtlib/fmt/pull/886>, #933 <https://github.com/fmtlib/fmt/pull/933>, #941 <https://github.com/fmtlib/fmt/pull/941>, #931 <https://github.com/fmtlib/fmt/issues/931>, #943 <https://github.com/fmtlib/fmt/pull/943>, #954 <https://github.com/fmtlib/fmt/pull/954>, #956 <https://github.com/fmtlib/fmt/pull/956>, #962 <https://github.com/fmtlib/fmt/pull/962>, #965 <https://github.com/fmtlib/fmt/issues/965>, #977 <https://github.com/fmtlib/fmt/issues/977>, #983 <https://github.com/fmtlib/fmt/pull/983>, #989 <https://github.com/fmtlib/fmt/pull/989>). Thanks @Luthaf (Guillaume Fraux) <https://github.com/Luthaf>, @stevenhoving (Steven Hoving) <https://github.com/stevenhoving>, @christinaa (Kristina Brooks) <https://github.com/christinaa>, @lgritz (Larry Gritz) <https://github.com/lgritz>, @DanielaE (Daniela Engert) <https://github.com/DanielaE>, @0x8000-0000 (Sign Bit) <https://github.com/0x8000-0000>, @liuping1997 <https://github.com/liuping1997>.

  • v5.2.1

    September 21, 2018
    • ๐Ÿ›  Fixed visit lookup issues on gcc 7 & 8 (#870 <https://github.com/fmtlib/fmt/pull/870>). Thanks @medithe <https://github.com/medithe>.

    • ๐Ÿ›  Fixed linkage errors on older gcc.

    • Prevented fmt/range.h from specializing fmt::basic_string_view (#865 <https://github.com/fmtlib/fmt/issues/865>, #868 <https://github.com/fmtlib/fmt/pull/868>). Thanks @hhggit (dual) <https://github.com/hhggit>_.

    • ๐Ÿ‘Œ Improved error message when formatting unknown types (#872 <https://github.com/fmtlib/fmt/pull/872>). Thanks @foonathan (Jonathan Mรผller) <https://github.com/foonathan>,

    • Disabled templated user-defined literals when compiled under nvcc (#875 <https://github.com/fmtlib/fmt/pull/875>). Thanks @CandyGumdrop (Candy Gumdrop) <https://github.com/CandyGumdrop>,

    • Fixed format_to formatting to wmemory_buffer (#874 <https://github.com/fmtlib/fmt/issues/874>_).

  • v5.2.0

    September 13, 2018
    • โšก๏ธ Optimized format string parsing and argument processing which resulted in up to 5x speed up on long format strings and significant performance boost on various benchmarks. For example, version 5.2 is 2.22x faster than 5.1 on decimal integer formatting with format_to (macOS, clang-902.0.39.2):

    ================== ======= ======= Method Time, s Speedup ================== ======= ======= fmt::format 5.1 0.58 fmt::format 5.2 0.35 1.66x fmt::format_to 5.1 0.51 fmt::format_to 5.2 0.23 2.22x sprintf 0.71 std::to_string 1.01 std::stringstream 1.73 ================== ======= =======

    • ๐Ÿ”„ Changed the fmt macro from opt-out to opt-in to prevent name collisions. To enable it define the FMT_STRING_ALIAS macro to 1 before including fmt/format.h:

    .. code:: c++

     #define FMT_STRING_ALIAS 1
     #include <fmt/format.h>
     std::string answer = format(fmt("{}"), 42);
    
    • โž• Added compile-time format string checks to format_to overload that takes fmt::memory_buffer (#783 <https://github.com/fmtlib/fmt/issues/783>_):

    .. code:: c++

     fmt::memory_buffer buf;
     // Compile-time error: invalid type specifier.
     fmt::format_to(buf, fmt("{:d}"), "foo");
    
    • ๐Ÿšš Moved experimental color support to fmt/color.h and enabled the new API by default. The old API can be enabled by defining the FMT_DEPRECATED_COLORS macro.

    • โž• Added formatting support for types explicitly convertible to fmt::string_view:

    .. code:: c++

     struct foo {
       explicit operator fmt::string_view() const { return "foo"; }
     };
     auto s = format("{}", foo());
    

    In particular, this makes formatting function work with folly::StringPiece.

    • ๐Ÿ‘ Implemented preliminary support for char*_t by replacing the format function overloads with a single function template parameterized on the string type.

    • โž• Added support for dynamic argument lists (#814 <https://github.com/fmtlib/fmt/issues/814>, #819 <https://github.com/fmtlib/fmt/pull/819>). Thanks @MikePopoloski (Michael Popoloski) <https://github.com/MikePopoloski>_.

    • โฌ‡๏ธ Reduced executable size overhead for embedded targets using newlib nano by making locale dependency optional (#839 <https://github.com/fmtlib/fmt/pull/839>). Thanks @teajay-fr (Thomas Benard) <https://github.com/teajay-fr>.

    • Keep noexcept specifier when exceptions are disabled (#801 <https://github.com/fmtlib/fmt/issues/801>, #810 <https://github.com/fmtlib/fmt/pull/810>). Thanks @qis (Alexej Harm) <https://github.com/qis>_.

    • ๐Ÿ›  Fixed formatting of user-defined types providing operator<< with format_to_n (#806 <https://github.com/fmtlib/fmt/pull/806>). Thanks @mkurdej (Marek Kurdej) <https://github.com/mkurdej>.

    • ๐Ÿ›  Fixed dynamic linkage of new symbols (#808 <https://github.com/fmtlib/fmt/issues/808>_).

    • ๐Ÿ›  Fixed global initialization issue (#807 <https://github.com/fmtlib/fmt/issues/807>_):

    .. code:: c++

     // This works on compilers with constexpr support.
     static const std::string answer = fmt::format("{}", 42);
    
    • ๐Ÿ›  Fixed various compiler warnings and errors (#804 <https://github.com/fmtlib/fmt/pull/804>, #809 <https://github.com/fmtlib/fmt/issues/809>, #811 <https://github.com/fmtlib/fmt/pull/811>, #822 <https://github.com/fmtlib/fmt/issues/822>, #827 <https://github.com/fmtlib/fmt/pull/827>, #830 <https://github.com/fmtlib/fmt/issues/830>, #838 <https://github.com/fmtlib/fmt/pull/838>, #843 <https://github.com/fmtlib/fmt/issues/843>, #844 <https://github.com/fmtlib/fmt/pull/844>, #851 <https://github.com/fmtlib/fmt/issues/851>, #852 <https://github.com/fmtlib/fmt/pull/852>, #854 <https://github.com/fmtlib/fmt/pull/854>). Thanks @henryiii (Henry Schreiner) <https://github.com/henryiii>, @medithe <https://github.com/medithe>, and @eliasdaler (Elias Daler) <https://github.com/eliasdaler>_.
  • v5.1.0

    July 05, 2018
    • โž• Added experimental support for RGB color output enabled with the FMT_EXTENDED_COLORS macro:

    .. code:: c++

     #define FMT_EXTENDED_COLORS
     #define FMT_HEADER_ONLY // or compile fmt with FMT_EXTENDED_COLORS defined
     #include <fmt/format.h>
    
     fmt::print(fmt::color::steel_blue, "Some beautiful text");
    

    The old API (the print_colored and vprint_colored functions and the color enum) is now deprecated. (#762 <https://github.com/fmtlib/fmt/issues/762>_ #767 <https://github.com/fmtlib/fmt/pull/767>). thanks @remotion (remo) <https://github.com/remotion>.

    • โž• Added quotes to strings in ranges and tuples (#766 <https://github.com/fmtlib/fmt/pull/766>). Thanks @Remotion (Remo) <https://github.com/Remotion>.

    • Made format_to work with basic_memory_buffer (#776 <https://github.com/fmtlib/fmt/issues/776>_).

    • Added vformat_to_n and wchar_t overload of format_to_n (#764 <https://github.com/fmtlib/fmt/issues/764>, #769 <https://github.com/fmtlib/fmt/issues/769>).

    • Made is_range and is_tuple_like part of public (experimental) API to allow specialization for user-defined types (#751 <https://github.com/fmtlib/fmt/issues/751>, #759 <https://github.com/fmtlib/fmt/pull/759>). Thanks @drrlvn (Dror Levin) <https://github.com/drrlvn>_.

    • โž• Added more compilers to continuous integration and increased FMT_PEDANTIC warning levels (#736 <https://github.com/fmtlib/fmt/pull/736>). Thanks @eliaskosunen (Elias Kosunen) <https://github.com/eliaskosunen>.

    • ๐Ÿ›  Fixed compilation with MSVC 2013.

    • ๐Ÿ›  Fixed handling of user-defined types in format_to (#793 <https://github.com/fmtlib/fmt/issues/793>_).

    • ๐Ÿ‘ฎ Forced linking of inline vformat functions into the library (#795 <https://github.com/fmtlib/fmt/issues/795>_).

    • ๐Ÿ›  Fixed incorrect call to on_align in '{:}=' (#750 <https://github.com/fmtlib/fmt/issues/750>_).

    • Fixed floating-point formatting to a non-back_insert_iterator with sign & numeric alignment specified (#756 <https://github.com/fmtlib/fmt/issues/756>_).

    • Fixed formatting to an array with format_to_n (#778 <https://github.com/fmtlib/fmt/issues/778>_).

    • ๐Ÿ›  Fixed formatting of more than 15 named arguments (#754 <https://github.com/fmtlib/fmt/issues/754>_).

    • ๐Ÿ›  Fixed handling of compile-time strings when including fmt/ostream.h. (#768 <https://github.com/fmtlib/fmt/issues/768>_).

    • ๐Ÿ›  Fixed various compiler warnings and errors (#742 <https://github.com/fmtlib/fmt/issues/742>, #748 <https://github.com/fmtlib/fmt/issues/748>, #752 <https://github.com/fmtlib/fmt/issues/752>, #770 <https://github.com/fmtlib/fmt/issues/770>, #775 <https://github.com/fmtlib/fmt/pull/775>, #779 <https://github.com/fmtlib/fmt/issues/779>, #780 <https://github.com/fmtlib/fmt/pull/780>, #790 <https://github.com/fmtlib/fmt/pull/790>, #792 <https://github.com/fmtlib/fmt/pull/792>, #800 <https://github.com/fmtlib/fmt/pull/800>). Thanks @Remotion (Remo) <https://github.com/Remotion>, @gabime (Gabi Melman) <https://github.com/gabime>, @foonathan (Jonathan Mรผller) <https://github.com/foonathan>, @Dark-Passenger (Dhruv Paranjape) <https://github.com/Dark-Passenger>, and @0x8000-0000 (Sign Bit) <https://github.com/0x8000-0000>_.

  • v5.0.0

    May 21, 2018
    • โž• Added a requirement for partial C++11 support, most importantly variadic templates and type traits, and dropped FMT_VARIADIC_* emulation macros. Variadic templates are available since GCC 4.4, Clang 2.9 and MSVC 18.0 (2013). For older compilers use {fmt} version 4.x <https://github.com/fmtlib/fmt/releases/tag/4.1.0>_ which continues to be maintained and works with C++98 compilers.

    • ๐Ÿ“‡ Renamed symbols to follow standard C++ naming conventions and proposed a subset of the library for standardization in P0645R2 Text Formatting <https://wg21.link/P0645>_.

    • ๐Ÿ“œ Implemented constexpr parsing of format strings and compile-time format string checks <https://fmt.dev/latest/api.html#compile-time-format-string-checks>_. For example

    .. code:: c++

     #include <fmt/format.h>
    
     std::string s = format(fmt("{:d}"), "foo");
    

    gives a compile-time error because d is an invalid specifier for strings (godbolt <https://godbolt.org/g/rnCy9Q>__)::

     ...
     <source>:4:19: note: in instantiation of function template specialization 'fmt::v5::format<S, char [4]>' requested here
       std::string s = format(fmt("{:d}"), "foo");
                       ^
     format.h:1337:13: note: non-constexpr function 'on_error' cannot be used in a constant expression
         handler.on_error("invalid type specifier");
    

    Compile-time checks require relaxed constexpr (C++14 feature) support. If the latter is not available, checks will be performed at runtime.

    • ๐Ÿ“œ Separated format string parsing and formatting in the extension API to enable compile-time format string processing. For example

    .. code:: c++

     struct Answer {};
    
     namespace fmt {
     template <>
     struct formatter<Answer> {
       constexpr auto parse(parse_context& ctx) {
         auto it = ctx.begin();
         spec = *it;
         if (spec != 'd' && spec != 's')
           throw format_error("invalid specifier");
         return ++it;
       }
    
       template <typename FormatContext>
       auto format(Answer, FormatContext& ctx) {
         return spec == 's' ?
           format_to(ctx.begin(), "{}", "fourty-two") :
           format_to(ctx.begin(), "{}", 42);
       }
    
       char spec = 0;
     };
     }
    
     std::string s = format(fmt("{:x}"), Answer());
    

    gives a compile-time error due to invalid format specifier (godbolt <https://godbolt.org/g/2jQ1Dv>__)::

     ...
     <source>:12:45: error: expression '<throw-expression>' is not a constant expression
            throw format_error("invalid specifier");
    
    • โž• Added iterator support <https://fmt.dev/latest/api.html#output-iterator-support>_:

    .. code:: c++

     #include <vector>
     #include <fmt/format.h>
    
     std::vector<char> out;
     fmt::format_to(std::back_inserter(out), "{}", 42);
    
    • Added the format_to_n <https://fmt.dev/latest/api.html#_CPPv2N3fmt11format_to_nE8OutputItNSt6size_tE11string_viewDpRK4Args>_ function that restricts the output to the specified number of characters (#298 <https://github.com/fmtlib/fmt/issues/298>_):

    .. code:: c++

     char out[4];
     fmt::format_to_n(out, sizeof(out), "{}", 12345);
     // out == "1234" (without terminating '\0')
    
    • โž• Added the formatted_size <https://fmt.dev/latest/api.html#_CPPv2N3fmt14formatted_sizeE11string_viewDpRK4Args>_ function for computing the output size:

    .. code:: c++

     #include <fmt/format.h>
    
     auto size = fmt::formatted_size("{}", 12345); // size == 5
    
    • ๐Ÿ‘Œ Improved compile times by reducing dependencies on standard headers and providing a lightweight core API <https://fmt.dev/latest/api.html#core-api>_:

    .. code:: c++

     #include <fmt/core.h>
    
     fmt::print("The answer is {}.", 42);
    

    See Compile time and code bloat <https://github.com/fmtlib/fmt#compile-time-and-code-bloat>_.

    • Added the make_format_args <https://fmt.dev/latest/api.html#_CPPv2N3fmt16make_format_argsEDpRK4Args>_ function for capturing formatting arguments:

    .. code:: c++

     // Prints formatted error message.
     void vreport_error(const char *format, fmt::format_args args) {
       fmt::print("Error: ");
       fmt::vprint(format, args);
     }
     template <typename... Args>
     void report_error(const char *format, const Args & ... args) {
       vreport_error(format, fmt::make_format_args(args...));
     }
    
    • ๐Ÿ–จ Added the make_printf_args function for capturing printf arguments (#687 <https://github.com/fmtlib/fmt/issues/687>, #694 <https://github.com/fmtlib/fmt/pull/694>). Thanks @Kronuz (Germรกn Mรฉndez Bravo) <https://github.com/Kronuz>_.

    • โž• Added prefix v to non-variadic functions taking format_args to distinguish them from variadic ones:

    .. code:: c++

     std::string vformat(string_view format_str, format_args args);
    
     template <typename... Args>
     std::string format(string_view format_str, const Args & ... args);
    
    • โž• Added experimental support for formatting ranges, containers and tuple-like types in fmt/ranges.h (#735 <https://github.com/fmtlib/fmt/pull/735>_):

    .. code:: c++

     #include <fmt/ranges.h>
    
     std::vector<int> v = {1, 2, 3};
     fmt::print("{}", v); // prints {1, 2, 3}
    

    Thanks @Remotion (Remo) <https://github.com/Remotion>_.

    • Implemented wchar_t date and time formatting (#712 <https://github.com/fmtlib/fmt/pull/712>_):

    .. code:: c++

     #include <fmt/time.h>
    
     std::time_t t = std::time(nullptr);
     auto s = fmt::format(L"The date is {:%Y-%m-%d}.", *std::localtime(&t));
    

    Thanks @DanielaE (Daniela Engert) <https://github.com/DanielaE>_.

    • Provided more wide string overloads (#724 <https://github.com/fmtlib/fmt/pull/724>). Thanks @DanielaE (Daniela Engert) <https://github.com/DanielaE>.

    • Switched from a custom null-terminated string view class to string_view in the format API and provided fmt::string_view which implements a subset of std::string_view API for pre-C++17 systems.

    • โž• Added support for std::experimental::string_view (#607 <https://github.com/fmtlib/fmt/pull/607>_):

    .. code:: c++

     #include <fmt/core.h>
     #include <experimental/string_view>
    
     fmt::print("{}", std::experimental::string_view("foo"));
    

    Thanks @virgiliofornazin (Virgilio Alexandre Fornazin) <https://github.com/virgiliofornazin>__.

    • ๐Ÿ‘ Allowed mixing named and automatic arguments:

    .. code:: c++

     fmt::format("{} {two}", 1, fmt::arg("two", 2));
    
    • โœ‚ Removed the write API in favor of the format API <https://fmt.dev/latest/api.html#format-api>_ with compile-time handling of format strings.

    • Disallowed formatting of multibyte strings into a wide character target (#606 <https://github.com/fmtlib/fmt/pull/606>_).

    • ๐Ÿ‘Œ Improved documentation (#515 <https://github.com/fmtlib/fmt/pull/515>, #614 <https://github.com/fmtlib/fmt/issues/614>, #617 <https://github.com/fmtlib/fmt/pull/617>, #661 <https://github.com/fmtlib/fmt/pull/661>, #680 <https://github.com/fmtlib/fmt/pull/680>). Thanks @ibell (Ian Bell) <https://github.com/ibell>, @mihaitodor (Mihai Todor) <https://github.com/mihaitodor>, and @johnthagen <https://github.com/johnthagen>.

    • Implemented more efficient handling of large number of format arguments.

    • Introduced an inline namespace for symbol versioning.

    • โž• Added debug postfix d to the fmt library name (#636 <https://github.com/fmtlib/fmt/issues/636>_).

    • โœ‚ Removed unnecessary fmt/ prefix in includes (#397 <https://github.com/fmtlib/fmt/pull/397>). Thanks @chronoxor (Ivan Shynkarenka) <https://github.com/chronoxor>.

    • Moved fmt/*.h to include/fmt/*.h to prevent irrelevant files and directories appearing on the include search paths when fmt is used as a subproject and moved source files to the src directory.

    • โž• Added qmake project file support/fmt.pro (#641 <https://github.com/fmtlib/fmt/pull/641>). Thanks @cowo78 (Giuseppe Corbelli) <https://github.com/cowo78>.

    • โž• Added Gradle build file support/build.gradle (#649 <https://github.com/fmtlib/fmt/pull/649>). Thanks @luncliff (Park DongHa) <https://github.com/luncliff>.

    • โœ‚ Removed FMT_CPPFORMAT CMake option.

    • ๐Ÿ›  Fixed a name conflict with the macro CHAR_WIDTH in glibc (#616 <https://github.com/fmtlib/fmt/pull/616>). Thanks @aroig (Abdรณ Roig-Maranges) <https://github.com/aroig>.

    • ๐Ÿ›  Fixed handling of nested braces in fmt::join (#638 <https://github.com/fmtlib/fmt/issues/638>_).

    • โž• Added SOURCELINK_SUFFIX for compatibility with Sphinx 1.5 (#497 <https://github.com/fmtlib/fmt/pull/497>). Thanks @ginggs (Graham Inggs) <https://github.com/ginggs>.

    • โž• Added a missing inline in the header-only mode (#626 <https://github.com/fmtlib/fmt/pull/626>). Thanks @aroig (Abdรณ Roig-Maranges) <https://github.com/aroig>.

    • ๐Ÿ›  Fixed various compiler warnings (#640 <https://github.com/fmtlib/fmt/pull/640>, #656 <https://github.com/fmtlib/fmt/pull/656>, #679 <https://github.com/fmtlib/fmt/pull/679>, #681 <https://github.com/fmtlib/fmt/pull/681>, #705 <https://github.com/fmtlib/fmt/pull/705>_, #715 <https://github.com/fmtlib/fmt/issues/715>, #717 <https://github.com/fmtlib/fmt/pull/717>, #720 <https://github.com/fmtlib/fmt/pull/720>, #723 <https://github.com/fmtlib/fmt/pull/723>, #726 <https://github.com/fmtlib/fmt/pull/726>, #730 <https://github.com/fmtlib/fmt/pull/730>, #739 <https://github.com/fmtlib/fmt/pull/739>). Thanks @peterbell10 <https://github.com/peterbell10>, @LarsGullik <https://github.com/LarsGullik>, @foonathan (Jonathan Mรผller) <https://github.com/foonathan>, @eliaskosunen (Elias Kosunen) <https://github.com/eliaskosunen>, @christianparpart (Christian Parpart) <https://github.com/christianparpart>, @DanielaE (Daniela Engert) <https://github.com/DanielaE>, and @mwinterb <https://github.com/mwinterb>_.

    • โš  Worked around an MSVC bug and fixed several warnings (#653 <https://github.com/fmtlib/fmt/pull/653>). Thanks @alabuzhev (Alex Alabuzhev) <https://github.com/alabuzhev>.

    • Worked around GCC bug 67371 (#682 <https://github.com/fmtlib/fmt/issues/682>_).

    • ๐Ÿ›  Fixed compilation with -fno-exceptions (#655 <https://github.com/fmtlib/fmt/pull/655>). Thanks @chenxiaolong (Andrew Gunnerson) <https://github.com/chenxiaolong>.

    • ๐Ÿšš Made constexpr remove_prefix gcc version check tighter (#648 <https://github.com/fmtlib/fmt/issues/648>_).

    • ๐Ÿ“‡ Renamed internal type enum constants to prevent collision with poorly written C libraries (#644 <https://github.com/fmtlib/fmt/issues/644>_).

    • โž• Added detection of wostream operator<< (#650 <https://github.com/fmtlib/fmt/issues/650>_).

    • ๐Ÿ›  Fixed compilation on OpenBSD (#660 <https://github.com/fmtlib/fmt/pull/660>). Thanks @hubslave <https://github.com/hubslave>.

    • ๐Ÿ›  Fixed compilation on FreeBSD 12 (#732 <https://github.com/fmtlib/fmt/pull/732>). Thanks @dankm <https://github.com/dankm>.

    • ๐Ÿ›  Fixed compilation when there is a mismatch between -std options between the library and user code (#664 <https://github.com/fmtlib/fmt/issues/664>_).

    • ๐Ÿ›  Fixed compilation with GCC 7 and -std=c++11 (#734 <https://github.com/fmtlib/fmt/issues/734>_).

    • ๐Ÿ‘Œ Improved generated binary code on GCC 7 and older (#668 <https://github.com/fmtlib/fmt/issues/668>_).

    • ๐Ÿ›  Fixed handling of numeric alignment with no width (#675 <https://github.com/fmtlib/fmt/issues/675>_).

    • ๐Ÿ›  Fixed handling of empty strings in UTF8/16 converters (#676 <https://github.com/fmtlib/fmt/pull/676>). Thanks @vgalka-sl (Vasili Galka) <https://github.com/vgalka-sl>.

    • ๐Ÿ›  Fixed formatting of an empty string_view (#689 <https://github.com/fmtlib/fmt/issues/689>_).

    • ๐Ÿ›  Fixed detection of string_view on libc++ (#686 <https://github.com/fmtlib/fmt/issues/686>_).

    • ๐Ÿ›  Fixed DLL issues (#696 <https://github.com/fmtlib/fmt/pull/696>). Thanks @sebkoenig <https://github.com/sebkoenig>.

    • ๐Ÿ›  Fixed compile checks for mixing narrow and wide strings (#690 <https://github.com/fmtlib/fmt/issues/690>_).

    • Disabled unsafe implicit conversion to std::string (#729 <https://github.com/fmtlib/fmt/issues/729>_).

    • ๐Ÿ›  Fixed handling of reused format specs (as in fmt::join) for pointers (#725 <https://github.com/fmtlib/fmt/pull/725>). Thanks @mwinterb <https://github.com/mwinterb>.

    • ๐Ÿ›  Fixed installation of fmt/ranges.h (#738 <https://github.com/fmtlib/fmt/pull/738>). Thanks @sv1990 <https://github.com/sv1990>.

  • v4.1.0

    December 20, 2017
    • Added fmt::to_wstring() in addition to fmt::to_string() (#559 <https://github.com/fmtlib/fmt/pull/559>). Thanks @alabuzhev (Alex Alabuzhev) <https://github.com/alabuzhev>.

    • โž• Added support for C++17 std::string_view (#571 <https://github.com/fmtlib/fmt/pull/571>_ and #578 <https://github.com/fmtlib/fmt/pull/578>). Thanks @thelostt (Mรกrio Feroldi) <https://github.com/thelostt> and @mwinterb <https://github.com/mwinterb>_.

    • Enabled stream exceptions to catch errors (#581 <https://github.com/fmtlib/fmt/issues/581>). Thanks @crusader-mike <https://github.com/crusader-mike>.

    • ๐Ÿ‘ Allowed formatting of class hierarchies with fmt::format_arg() (#547 <https://github.com/fmtlib/fmt/pull/547>). Thanks @rollbear (Bjรถrn Fahller) <https://github.com/rollbear>.

    • โœ‚ Removed limitations on character types (#563 <https://github.com/fmtlib/fmt/pull/563>). Thanks @Yelnats321 (Elnar Dakeshov) <https://github.com/Yelnats321>.

    • Conditionally enabled use of std::allocator_traits (#583 <https://github.com/fmtlib/fmt/pull/583>). Thanks @mwinterb <https://github.com/mwinterb>.

    • โž• Added support for const variadic member function emulation with FMT_VARIADIC_CONST (#591 <https://github.com/fmtlib/fmt/pull/591>). Thanks @ludekvodicka (Ludek Vodicka) <https://github.com/ludekvodicka>.

    • ๐Ÿ›  Various bugfixes: bad overflow check, unsupported implicit type conversion when determining formatting function, test segfaults (#551 <https://github.com/fmtlib/fmt/issues/551>), ill-formed macros (#542 <https://github.com/fmtlib/fmt/pull/542>) and ambiguous overloads (#580 <https://github.com/fmtlib/fmt/issues/580>). Thanks @xylosper (Byoung-young Lee) <https://github.com/xylosper>.

    • โš  Prevented warnings on MSVC (#605 <https://github.com/fmtlib/fmt/pull/605>, #602 <https://github.com/fmtlib/fmt/pull/602>, and #545 <https://github.com/fmtlib/fmt/pull/545>), clang (#582 <https://github.com/fmtlib/fmt/pull/582>), GCC (#573 <https://github.com/fmtlib/fmt/issues/573>), various conversion warnings (#609 <https://github.com/fmtlib/fmt/pull/609>, #567 <https://github.com/fmtlib/fmt/pull/567>, #553 <https://github.com/fmtlib/fmt/pull/553> and #553 <https://github.com/fmtlib/fmt/pull/553>), and added override and [[noreturn]] (#549 <https://github.com/fmtlib/fmt/pull/549> and #555 <https://github.com/fmtlib/fmt/issues/555>). Thanks @alabuzhev (Alex Alabuzhev) <https://github.com/alabuzhev>, @virgiliofornazin (Virgilio Alexandre Fornazin) <https://gihtub.com/virgiliofornazin>, @alexanderbock (Alexander Bock) <https://github.com/alexanderbock>, @yumetodo <https://github.com/yumetodo>, @VaderY (Csรกszรกr Mรกtyรกs) <https://github.com/VaderY>, @jpcima (JP Cimalando) <https://github.com/jpcima>, @thelostt (Mรกrio Feroldi) <https://github.com/thelostt>, and @Manu343726 (Manu Sรกnchez) <https://github.com/Manu343726>_.

    • ๐Ÿ‘Œ Improved CMake: Used GNUInstallDirs to set installation location (#610 <https://github.com/fmtlib/fmt/pull/610>) and fixed warnings (#536 <https://github.com/fmtlib/fmt/pull/536> and #556 <https://github.com/fmtlib/fmt/pull/556>). Thanks @mikecrowe (Mike Crowe) <https://github.com/mikecrowe>, @evgen231 <https://github.com/evgen231>_ and @henryiii (Henry Schreiner) <https://github.com/henryiii>_.