16.1.1 - 2019-12-04 2------------------ 3 4* Fixed shared library build on Windows 5 (`#1443 <https://github.com/fmtlib/fmt/pull/1443>`_, 6 `#1445 <https://github.com/fmtlib/fmt/issues/1445>`_, 7 `#1446 <https://github.com/fmtlib/fmt/pull/1446>`_, 8 `#1450 <https://github.com/fmtlib/fmt/issues/1450>`_). 9 Thanks `@egorpugin (Egor Pugin) <https://github.com/egorpugin>`_, 10 `@bbolli (Beat Bolli) <https://github.com/bbolli>`_. 11 12* Added a missing decimal point in exponent notation with trailing zeros. 13 14* Removed deprecated ``format_arg_store::TYPES``. 15 166.1.0 - 2019-12-01 17------------------ 18 19* {fmt} now formats IEEE 754 ``float`` and ``double`` using the shortest decimal 20 representation with correct rounding by default: 21 22 .. code:: c++ 23 24 #include <cmath> 25 #include <fmt/core.h> 26 27 int main() { 28 fmt::print("{}", M_PI); 29 } 30 31 prints ``3.141592653589793``. 32 33* Made the fast binary to decimal floating-point formatter the default, 34 simplified it and improved performance. {fmt} is now 15 times faster than 35 libc++'s ``std::ostringstream``, 11 times faster than ``printf`` and 10% 36 faster than double-conversion on `dtoa-benchmark 37 <https://github.com/fmtlib/dtoa-benchmark>`_: 38 39 ================== ========= ======= 40 Function Time (ns) Speedup 41 ================== ========= ======= 42 ostringstream 1,346.30 1.00x 43 ostrstream 1,195.74 1.13x 44 sprintf 995.08 1.35x 45 doubleconv 99.10 13.59x 46 fmt 88.34 15.24x 47 ================== ========= ======= 48 49 .. image:: https://user-images.githubusercontent.com/576385/ 50 69767160-cdaca400-112f-11ea-9fc5-347c9f83caad.png 51 52* {fmt} no longer converts ``float`` arguments to ``double``. In particular this 53 improves the default (shortest) representation of floats and makes 54 ``fmt::format`` consistent with ``std::format`` specs 55 (`#1336 <https://github.com/fmtlib/fmt/issues/1336>`_, 56 `#1353 <https://github.com/fmtlib/fmt/issues/1353>`_, 57 `#1360 <https://github.com/fmtlib/fmt/pull/1360>`_, 58 `#1361 <https://github.com/fmtlib/fmt/pull/1361>`_): 59 60 .. code:: c++ 61 62 fmt::print("{}", 0.1f); 63 64 prints ``0.1`` instead of ``0.10000000149011612``. 65 66 Thanks `@orivej (Orivej Desh) <https://github.com/orivej>`_. 67 68* Made floating-point formatting output consistent with ``printf``/iostreams 69 (`#1376 <https://github.com/fmtlib/fmt/issues/1376>`_, 70 `#1417 <https://github.com/fmtlib/fmt/issues/1417>`_). 71 72* Added support for 128-bit integers 73 (`#1287 <https://github.com/fmtlib/fmt/pull/1287>`_): 74 75 .. code:: c++ 76 77 fmt::print("{}", std::numeric_limits<__int128_t>::max()); 78 79 prints ``170141183460469231731687303715884105727``. 80 81 Thanks `@denizevrenci (Deniz Evrenci) <https://github.com/denizevrenci>`_. 82 83* The overload of ``print`` that takes ``text_style`` is now atomic, i.e. the 84 output from different threads doesn't interleave 85 (`#1351 <https://github.com/fmtlib/fmt/pull/1351>`_). 86 Thanks `@tankiJong (Tanki Zhang) <https://github.com/tankiJong>`_. 87 88* Made compile time in the header-only mode ~20% faster by reducing the number 89 of template instantiations. ``wchar_t`` overload of ``vprint`` was moved from 90 ``fmt/core.h`` to ``fmt/format.h``. 91 92* Added an overload of ``fmt::join`` that works with tuples 93 (`#1322 <https://github.com/fmtlib/fmt/issues/1322>`_, 94 `#1330 <https://github.com/fmtlib/fmt/pull/1330>`_): 95 96 .. code:: c++ 97 98 #include <tuple> 99 #include <fmt/ranges.h> 100 101 int main() { 102 std::tuple<char, int, float> t{'a', 1, 2.0f}; 103 fmt::print("{}", t); 104 } 105 106 prints ``('a', 1, 2.0)``. 107 108 Thanks `@jeremyong (Jeremy Ong) <https://github.com/jeremyong>`_. 109 110* Changed formatting of octal zero with prefix from "00" to "0": 111 112 .. code:: c++ 113 114 fmt::print("{:#o}", 0); 115 116 prints ``0``. 117 118* The locale is now passed to ostream insertion (``<<``) operators 119 (`#1406 <https://github.com/fmtlib/fmt/pull/1406>`_): 120 121 .. code:: c++ 122 123 #include <fmt/locale.h> 124 #include <fmt/ostream.h> 125 126 struct S { 127 double value; 128 }; 129 130 std::ostream& operator<<(std::ostream& os, S s) { 131 return os << s.value; 132 } 133 134 int main() { 135 auto s = fmt::format(std::locale("fr_FR.UTF-8"), "{}", S{0.42}); 136 // s == "0,42" 137 } 138 139 Thanks `@dlaugt (Daniel Laügt) <https://github.com/dlaugt>`_. 140 141* Locale-specific number formatting now uses grouping 142 (`#1393 <https://github.com/fmtlib/fmt/issues/1393>`_ 143 `#1394 <https://github.com/fmtlib/fmt/pull/1394>`_). 144 Thanks `@skrdaniel <https://github.com/skrdaniel>`_. 145 146* Fixed handling of types with deleted implicit rvalue conversion to 147 ``const char**`` (`#1421 <https://github.com/fmtlib/fmt/issues/1421>`_): 148 149 .. code:: c++ 150 151 struct mystring { 152 operator const char*() const&; 153 operator const char*() &; 154 operator const char*() const&& = delete; 155 operator const char*() && = delete; 156 }; 157 mystring str; 158 fmt::print("{}", str); // now compiles 159 160* Enums are now mapped to correct underlying types instead of ``int`` 161 (`#1286 <https://github.com/fmtlib/fmt/pull/1286>`_). 162 Thanks `@agmt (Egor Seredin) <https://github.com/agmt>`_. 163 164* Enum classes are no longer implicitly converted to ``int`` 165 (`#1424 <https://github.com/fmtlib/fmt/issues/1424>`_). 166 167* Added ``basic_format_parse_context`` for consistency with C++20 168 ``std::format`` and deprecated ``basic_parse_context``. 169 170* Fixed handling of UTF-8 in precision 171 (`#1389 <https://github.com/fmtlib/fmt/issues/1389>`_, 172 `#1390 <https://github.com/fmtlib/fmt/pull/1390>`_). 173 Thanks `@tajtiattila (Attila Tajti) <https://github.com/tajtiattila>`_. 174 175* {fmt} can now be installed on Linux, macOS and Windows with 176 `Conda <https://docs.conda.io/en/latest/>`__ using its 177 `conda-forge <https://conda-forge.org>`__ 178 `package <https://github.com/conda-forge/fmt-feedstock>`__ 179 (`#1410 <https://github.com/fmtlib/fmt/pull/1410>`_):: 180 181 conda install -c conda-forge fmt 182 183 Thanks `@tdegeus (Tom de Geus) <https://github.com/tdegeus>`_. 184 185* Added a CUDA test (`#1285 <https://github.com/fmtlib/fmt/pull/1285>`_, 186 `#1317 <https://github.com/fmtlib/fmt/pull/1317>`_). 187 Thanks `@luncliff (Park DongHa) <https://github.com/luncliff>`_ and 188 `@risa2000 <https://github.com/risa2000>`_. 189 190* Improved documentation (`#1276 <https://github.com/fmtlib/fmt/pull/1276>`_, 191 `#1291 <https://github.com/fmtlib/fmt/issues/1291>`_, 192 `#1296 <https://github.com/fmtlib/fmt/issues/1296>`_, 193 `#1315 <https://github.com/fmtlib/fmt/pull/1315>`_, 194 `#1332 <https://github.com/fmtlib/fmt/pull/1332>`_, 195 `#1337 <https://github.com/fmtlib/fmt/pull/1337>`_, 196 `#1395 <https://github.com/fmtlib/fmt/issues/1395>`_ 197 `#1418 <https://github.com/fmtlib/fmt/pull/1418>`_). 198 Thanks 199 `@waywardmonkeys (Bruce Mitchener) <https://github.com/waywardmonkeys>`_, 200 `@pauldreik (Paul Dreik) <https://github.com/pauldreik>`_, 201 `@jackoalan (Jack Andersen) <https://github.com/jackoalan>`_. 202 203* Various code improvements 204 (`#1358 <https://github.com/fmtlib/fmt/pull/1358>`_, 205 `#1407 <https://github.com/fmtlib/fmt/pull/1407>`_). 206 Thanks `@orivej (Orivej Desh) <https://github.com/orivej>`_, 207 `@dpacbach (David P. Sicilia) <https://github.com/dpacbach>`_, 208 209* Fixed compile-time format string checks for user-defined types 210 (`#1292 <https://github.com/fmtlib/fmt/issues/1292>`_). 211 212* Worked around a false positive in ``unsigned-integer-overflow`` sanitizer 213 (`#1377 <https://github.com/fmtlib/fmt/issues/1377>`_). 214 215* Fixed various warnings and compilation issues 216 (`#1273 <https://github.com/fmtlib/fmt/issues/1273>`_, 217 `#1278 <https://github.com/fmtlib/fmt/pull/1278>`_, 218 `#1280 <https://github.com/fmtlib/fmt/pull/1280>`_, 219 `#1281 <https://github.com/fmtlib/fmt/issues/1281>`_, 220 `#1288 <https://github.com/fmtlib/fmt/issues/1288>`_, 221 `#1290 <https://github.com/fmtlib/fmt/pull/1290>`_, 222 `#1301 <https://github.com/fmtlib/fmt/pull/1301>`_, 223 `#1305 <https://github.com/fmtlib/fmt/issues/1305>`_, 224 `#1306 <https://github.com/fmtlib/fmt/issues/1306>`_, 225 `#1309 <https://github.com/fmtlib/fmt/issues/1309>`_, 226 `#1312 <https://github.com/fmtlib/fmt/pull/1312>`_, 227 `#1313 <https://github.com/fmtlib/fmt/issues/1313>`_, 228 `#1316 <https://github.com/fmtlib/fmt/issues/1316>`_, 229 `#1319 <https://github.com/fmtlib/fmt/issues/1319>`_, 230 `#1320 <https://github.com/fmtlib/fmt/pull/1320>`_, 231 `#1326 <https://github.com/fmtlib/fmt/pull/1326>`_, 232 `#1328 <https://github.com/fmtlib/fmt/pull/1328>`_, 233 `#1344 <https://github.com/fmtlib/fmt/issues/1344>`_, 234 `#1345 <https://github.com/fmtlib/fmt/pull/1345>`_, 235 `#1347 <https://github.com/fmtlib/fmt/pull/1347>`_, 236 `#1349 <https://github.com/fmtlib/fmt/pull/1349>`_, 237 `#1354 <https://github.com/fmtlib/fmt/issues/1354>`_, 238 `#1362 <https://github.com/fmtlib/fmt/issues/1362>`_, 239 `#1366 <https://github.com/fmtlib/fmt/issues/1366>`_, 240 `#1364 <https://github.com/fmtlib/fmt/pull/1364>`_, 241 `#1370 <https://github.com/fmtlib/fmt/pull/1370>`_, 242 `#1371 <https://github.com/fmtlib/fmt/pull/1371>`_, 243 `#1385 <https://github.com/fmtlib/fmt/issues/1385>`_, 244 `#1388 <https://github.com/fmtlib/fmt/issues/1388>`_, 245 `#1397 <https://github.com/fmtlib/fmt/pull/1397>`_, 246 `#1414 <https://github.com/fmtlib/fmt/pull/1414>`_, 247 `#1416 <https://github.com/fmtlib/fmt/pull/1416>`_, 248 `#1422 <https://github.com/fmtlib/fmt/issues/1422>`_ 249 `#1427 <https://github.com/fmtlib/fmt/pull/1427>`_, 250 `#1431 <https://github.com/fmtlib/fmt/issues/1431>`_, 251 `#1433 <https://github.com/fmtlib/fmt/pull/1433>`_). 252 Thanks `@hhb <https://github.com/hhb>`_, 253 `@gsjaardema (Greg Sjaardema) <https://github.com/gsjaardema>`_, 254 `@gabime (Gabi Melman) <https://github.com/gabime>`_, 255 `@neheb (Rosen Penev) <https://github.com/neheb>`_, 256 `@vedranmiletic (Vedran Miletić) <https://github.com/vedranmiletic>`_, 257 `@dkavolis (Daumantas Kavolis) <https://github.com/dkavolis>`_, 258 `@mwinterb <https://github.com/mwinterb>`_, 259 `@orivej (Orivej Desh) <https://github.com/orivej>`_, 260 `@denizevrenci (Deniz Evrenci) <https://github.com/denizevrenci>`_ 261 `@leonklingele <https://github.com/leonklingele>`_, 262 `@chronoxor (Ivan Shynkarenka) <https://github.com/chronoxor>`_, 263 `@kent-tri <https://github.com/kent-tri>`_, 264 `@0x8000-0000 (Florin Iucha) <https://github.com/0x8000-0000>`_, 265 `@marti4d (Chris Martin) <https://github.com/marti4d>`_. 266 2676.0.0 - 2019-08-26 268------------------ 269 270* Switched to the `MIT license 271 <https://github.com/fmtlib/fmt/blob/5a4b24613ba16cc689977c3b5bd8274a3ba1dd1f/LICENSE.rst>`_ 272 with an optional exception that allows distributing binary code without 273 attribution. 274 275* Floating-point formatting is now locale-independent by default: 276 277 .. code:: c++ 278 279 #include <locale> 280 #include <fmt/core.h> 281 282 int main() { 283 std::locale::global(std::locale("ru_RU.UTF-8")); 284 fmt::print("value = {}", 4.2); 285 } 286 287 prints "value = 4.2" regardless of the locale. 288 289 For locale-specific formatting use the ``n`` specifier: 290 291 .. code:: c++ 292 293 std::locale::global(std::locale("ru_RU.UTF-8")); 294 fmt::print("value = {:n}", 4.2); 295 296 prints "value = 4,2". 297 298* Added an experimental Grisu floating-point formatting algorithm 299 implementation (disabled by default). To enable it compile with the 300 ``FMT_USE_GRISU`` macro defined to 1: 301 302 .. code:: c++ 303 304 #define FMT_USE_GRISU 1 305 #include <fmt/format.h> 306 307 auto s = fmt::format("{}", 4.2); // formats 4.2 using Grisu 308 309 With Grisu enabled, {fmt} is 13x faster than ``std::ostringstream`` (libc++) 310 and 10x faster than ``sprintf`` on `dtoa-benchmark 311 <https://github.com/fmtlib/dtoa-benchmark>`_ (`full results 312 <https://fmt.dev/unknown_mac64_clang10.0.html>`_): 313 314 .. image:: https://user-images.githubusercontent.com/576385/ 315 54883977-9fe8c000-4e28-11e9-8bde-272d122e7c52.jpg 316 317* Separated formatting and parsing contexts for consistency with 318 `C++20 std::format <http://eel.is/c++draft/format>`_, removing the 319 undocumented ``basic_format_context::parse_context()`` function. 320 321* Added `oss-fuzz <https://github.com/google/oss-fuzz>`_ support 322 (`#1199 <https://github.com/fmtlib/fmt/pull/1199>`_). 323 Thanks `@pauldreik (Paul Dreik) <https://github.com/pauldreik>`_. 324 325* ``formatter`` specializations now always take precedence over ``operator<<`` 326 (`#952 <https://github.com/fmtlib/fmt/issues/952>`_): 327 328 .. code:: c++ 329 330 #include <iostream> 331 #include <fmt/ostream.h> 332 333 struct S {}; 334 335 std::ostream& operator<<(std::ostream& os, S) { 336 return os << 1; 337 } 338 339 template <> 340 struct fmt::formatter<S> : fmt::formatter<int> { 341 auto format(S, format_context& ctx) { 342 return formatter<int>::format(2, ctx); 343 } 344 }; 345 346 int main() { 347 std::cout << S() << "\n"; // prints 1 using operator<< 348 fmt::print("{}\n", S()); // prints 2 using formatter 349 } 350 351* Introduced the experimental ``fmt::compile`` function that does format string 352 compilation (`#618 <https://github.com/fmtlib/fmt/issues/618>`_, 353 `#1169 <https://github.com/fmtlib/fmt/issues/1169>`_, 354 `#1171 <https://github.com/fmtlib/fmt/pull/1171>`_): 355 356 .. code:: c++ 357 358 #include <fmt/compile.h> 359 360 auto f = fmt::compile<int>("{}"); 361 std::string s = fmt::format(f, 42); // can be called multiple times to format 362 // different values 363 // s == "42" 364 365 It moves the cost of parsing a format string outside of the format function 366 which can be beneficial when identically formatting many objects of the same 367 types. Thanks `@stryku (Mateusz Janek) <https://github.com/stryku>`_. 368 369* Added the ``%`` format specifier that formats floating-point values as 370 percentages (`#1060 <https://github.com/fmtlib/fmt/pull/1060>`_, 371 `#1069 <https://github.com/fmtlib/fmt/pull/1069>`_, 372 `#1071 <https://github.com/fmtlib/fmt/pull/1071>`_): 373 374 .. code:: c++ 375 376 auto s = fmt::format("{:.1%}", 0.42); // s == "42.0%" 377 378 Thanks `@gawain-bolton (Gawain Bolton) <https://github.com/gawain-bolton>`_. 379 380* Implemented precision for floating-point durations 381 (`#1004 <https://github.com/fmtlib/fmt/issues/1004>`_, 382 `#1012 <https://github.com/fmtlib/fmt/pull/1012>`_): 383 384 .. code:: c++ 385 386 auto s = fmt::format("{:.1}", std::chrono::duration<double>(1.234)); 387 // s == 1.2s 388 389 Thanks `@DanielaE (Daniela Engert) <https://github.com/DanielaE>`_. 390 391* Implemented ``chrono`` format specifiers ``%Q`` and ``%q`` that give the value 392 and the unit respectively (`#1019 <https://github.com/fmtlib/fmt/pull/1019>`_): 393 394 .. code:: c++ 395 396 auto value = fmt::format("{:%Q}", 42s); // value == "42" 397 auto unit = fmt::format("{:%q}", 42s); // unit == "s" 398 399 Thanks `@DanielaE (Daniela Engert) <https://github.com/DanielaE>`_. 400 401* Fixed handling of dynamic width in chrono formatter: 402 403 .. code:: c++ 404 405 auto s = fmt::format("{0:{1}%H:%M:%S}", std::chrono::seconds(12345), 12); 406 // ^ width argument index ^ width 407 // s == "03:25:45 " 408 409 Thanks Howard Hinnant. 410 411* Removed deprecated ``fmt/time.h``. Use ``fmt/chrono.h`` instead. 412 413* Added ``fmt::format`` and ``fmt::vformat`` overloads that take ``text_style`` 414 (`#993 <https://github.com/fmtlib/fmt/issues/993>`_, 415 `#994 <https://github.com/fmtlib/fmt/pull/994>`_): 416 417 .. code:: c++ 418 419 #include <fmt/color.h> 420 421 std::string message = fmt::format(fmt::emphasis::bold | fg(fmt::color::red), 422 "The answer is {}.", 42); 423 424 Thanks `@Naios (Denis Blank) <https://github.com/Naios>`_. 425 426* Removed the deprecated color API (``print_colored``). Use the new API, namely 427 ``print`` overloads that take ``text_style`` instead. 428 429* Made ``std::unique_ptr`` and ``std::shared_ptr`` formattable as pointers via 430 ``fmt::ptr`` (`#1121 <https://github.com/fmtlib/fmt/pull/1121>`_): 431 432 .. code:: c++ 433 434 std::unique_ptr<int> p = ...; 435 fmt::print("{}", fmt::ptr(p)); // prints p as a pointer 436 437 Thanks `@sighingnow (Tao He) <https://github.com/sighingnow>`_. 438 439* Made ``print`` and ``vprint`` report I/O errors 440 (`#1098 <https://github.com/fmtlib/fmt/issues/1098>`_, 441 `#1099 <https://github.com/fmtlib/fmt/pull/1099>`_). 442 Thanks `@BillyDonahue (Billy Donahue) <https://github.com/BillyDonahue>`_. 443 444* Marked deprecated APIs with the ``[[deprecated]]`` attribute and removed 445 internal uses of deprecated APIs 446 (`#1022 <https://github.com/fmtlib/fmt/pull/1022>`_). 447 Thanks `@eliaskosunen (Elias Kosunen) <https://github.com/eliaskosunen>`_. 448 449* Modernized the codebase using more C++11 features and removing workarounds. 450 Most importantly, ``buffer_context`` is now an alias template, so 451 use ``buffer_context<T>`` instead of ``buffer_context<T>::type``. 452 These features require GCC 4.8 or later. 453 454* ``formatter`` specializations now always take precedence over implicit 455 conversions to ``int`` and the undocumented ``convert_to_int`` trait 456 is now deprecated. 457 458* Moved the undocumented ``basic_writer``, ``writer``, and ``wwriter`` types 459 to the ``internal`` namespace. 460 461* Removed deprecated ``basic_format_context::begin()``. Use ``out()`` instead. 462 463* Disallowed passing the result of ``join`` as an lvalue to prevent misuse. 464 465* Refactored the undocumented structs that represent parsed format specifiers 466 to simplify the API and allow multibyte fill. 467 468* Moved SFINAE to template parameters to reduce symbol sizes. 469 470* Switched to ``fputws`` for writing wide strings so that it's no longer 471 required to call ``_setmode`` on Windows 472 (`#1229 <https://github.com/fmtlib/fmt/issues/1229>`_, 473 `#1243 <https://github.com/fmtlib/fmt/pull/1243>`_). 474 Thanks `@jackoalan (Jack Andersen) <https://github.com/jackoalan>`_. 475 476* Improved literal-based API 477 (`#1254 <https://github.com/fmtlib/fmt/pull/1254>`_). 478 Thanks `@sylveon (Charles Milette) <https://github.com/sylveon>`_. 479 480* Added support for exotic platforms without ``uintptr_t`` such as IBM i 481 (AS/400) which has 128-bit pointers and only 64-bit integers 482 (`#1059 <https://github.com/fmtlib/fmt/issues/1059>`_). 483 484* Added `Sublime Text syntax highlighting config 485 <https://github.com/fmtlib/fmt/blob/master/support/C%2B%2B.sublime-syntax>`_ 486 (`#1037 <https://github.com/fmtlib/fmt/issues/1037>`_). 487 Thanks `@Kronuz (Germán Méndez Bravo) <https://github.com/Kronuz>`_. 488 489* Added the ``FMT_ENFORCE_COMPILE_STRING`` macro to enforce the use of 490 compile-time format strings 491 (`#1231 <https://github.com/fmtlib/fmt/pull/1231>`_). 492 Thanks `@jackoalan (Jack Andersen) <https://github.com/jackoalan>`_. 493 494* Stopped setting ``CMAKE_BUILD_TYPE`` if {fmt} is a subproject 495 (`#1081 <https://github.com/fmtlib/fmt/issues/1081>`_). 496 497* Various build improvements 498 (`#1039 <https://github.com/fmtlib/fmt/pull/1039>`_, 499 `#1078 <https://github.com/fmtlib/fmt/pull/1078>`_, 500 `#1091 <https://github.com/fmtlib/fmt/pull/1091>`_, 501 `#1103 <https://github.com/fmtlib/fmt/pull/1103>`_, 502 `#1177 <https://github.com/fmtlib/fmt/pull/1177>`_). 503 Thanks `@luncliff (Park DongHa) <https://github.com/luncliff>`_, 504 `@jasonszang (Jason Shuo Zang) <https://github.com/jasonszang>`_, 505 `@olafhering (Olaf Hering) <https://github.com/olafhering>`_, 506 `@Lecetem <https://github.com/Lectem>`_, 507 `@pauldreik (Paul Dreik) <https://github.com/pauldreik>`_. 508 509* Improved documentation 510 (`#1049 <https://github.com/fmtlib/fmt/issues/1049>`_, 511 `#1051 <https://github.com/fmtlib/fmt/pull/1051>`_, 512 `#1083 <https://github.com/fmtlib/fmt/pull/1083>`_, 513 `#1113 <https://github.com/fmtlib/fmt/pull/1113>`_, 514 `#1114 <https://github.com/fmtlib/fmt/pull/1114>`_, 515 `#1146 <https://github.com/fmtlib/fmt/issues/1146>`_, 516 `#1180 <https://github.com/fmtlib/fmt/issues/1180>`_, 517 `#1250 <https://github.com/fmtlib/fmt/pull/1250>`_, 518 `#1252 <https://github.com/fmtlib/fmt/pull/1252>`_, 519 `#1265 <https://github.com/fmtlib/fmt/pull/1265>`_). 520 Thanks `@mikelui (Michael Lui) <https://github.com/mikelui>`_, 521 `@foonathan (Jonathan Müller) <https://github.com/foonathan>`_, 522 `@BillyDonahue (Billy Donahue) <https://github.com/BillyDonahue>`_, 523 `@jwakely (Jonathan Wakely) <https://github.com/jwakely>`_, 524 `@kaisbe (Kais Ben Salah) <https://github.com/kaisbe>`_, 525 `@sdebionne (Samuel Debionne) <https://github.com/sdebionne>`_. 526 527* Fixed ambiguous formatter specialization in ``fmt/ranges.h`` 528 (`#1123 <https://github.com/fmtlib/fmt/issues/1123>`_). 529 530* Fixed formatting of a non-empty ``std::filesystem::path`` which is an 531 infinitely deep range of its components 532 (`#1268 <https://github.com/fmtlib/fmt/issues/1268>`_). 533 534* Fixed handling of general output iterators when formatting characters 535 (`#1056 <https://github.com/fmtlib/fmt/issues/1056>`_, 536 `#1058 <https://github.com/fmtlib/fmt/pull/1058>`_). 537 Thanks `@abolz (Alexander Bolz) <https://github.com/abolz>`_. 538 539* Fixed handling of output iterators in ``formatter`` specialization for 540 ranges (`#1064 <https://github.com/fmtlib/fmt/issues/1064>`_). 541 542* Fixed handling of exotic character types 543 (`#1188 <https://github.com/fmtlib/fmt/issues/1188>`_). 544 545* Made chrono formatting work with exceptions disabled 546 (`#1062 <https://github.com/fmtlib/fmt/issues/1062>`_). 547 548* Fixed DLL visibility issues 549 (`#1134 <https://github.com/fmtlib/fmt/pull/1134>`_, 550 `#1147 <https://github.com/fmtlib/fmt/pull/1147>`_). 551 Thanks `@denchat <https://github.com/denchat>`_. 552 553* Disabled the use of UDL template extension on GCC 9 554 (`#1148 <https://github.com/fmtlib/fmt/issues/1148>`_). 555 556* Removed misplaced ``format`` compile-time checks from ``printf`` 557 (`#1173 <https://github.com/fmtlib/fmt/issues/1173>`_). 558 559* Fixed issues in the experimental floating-point formatter 560 (`#1072 <https://github.com/fmtlib/fmt/issues/1072>`_, 561 `#1129 <https://github.com/fmtlib/fmt/issues/1129>`_, 562 `#1153 <https://github.com/fmtlib/fmt/issues/1153>`_, 563 `#1155 <https://github.com/fmtlib/fmt/pull/1155>`_, 564 `#1210 <https://github.com/fmtlib/fmt/issues/1210>`_, 565 `#1222 <https://github.com/fmtlib/fmt/issues/1222>`_). 566 Thanks `@alabuzhev (Alex Alabuzhev) <https://github.com/alabuzhev>`_. 567 568* Fixed bugs discovered by fuzzing or during fuzzing integration 569 (`#1124 <https://github.com/fmtlib/fmt/issues/1124>`_, 570 `#1127 <https://github.com/fmtlib/fmt/issues/1127>`_, 571 `#1132 <https://github.com/fmtlib/fmt/issues/1132>`_, 572 `#1135 <https://github.com/fmtlib/fmt/pull/1135>`_, 573 `#1136 <https://github.com/fmtlib/fmt/issues/1136>`_, 574 `#1141 <https://github.com/fmtlib/fmt/issues/1141>`_, 575 `#1142 <https://github.com/fmtlib/fmt/issues/1142>`_, 576 `#1178 <https://github.com/fmtlib/fmt/issues/1178>`_, 577 `#1179 <https://github.com/fmtlib/fmt/issues/1179>`_, 578 `#1194 <https://github.com/fmtlib/fmt/issues/1194>`_). 579 Thanks `@pauldreik (Paul Dreik) <https://github.com/pauldreik>`_. 580 581* Fixed building tests on FreeBSD and Hurd 582 (`#1043 <https://github.com/fmtlib/fmt/issues/1043>`_). 583 Thanks `@jackyf (Eugene V. Lyubimkin) <https://github.com/jackyf>`_. 584 585* Fixed various warnings and compilation issues 586 (`#998 <https://github.com/fmtlib/fmt/pull/998>`_, 587 `#1006 <https://github.com/fmtlib/fmt/pull/1006>`_, 588 `#1008 <https://github.com/fmtlib/fmt/issues/1008>`_, 589 `#1011 <https://github.com/fmtlib/fmt/issues/1011>`_, 590 `#1025 <https://github.com/fmtlib/fmt/issues/1025>`_, 591 `#1027 <https://github.com/fmtlib/fmt/pull/1027>`_, 592 `#1028 <https://github.com/fmtlib/fmt/pull/1028>`_, 593 `#1029 <https://github.com/fmtlib/fmt/pull/1029>`_, 594 `#1030 <https://github.com/fmtlib/fmt/pull/1030>`_, 595 `#1031 <https://github.com/fmtlib/fmt/pull/1031>`_, 596 `#1054 <https://github.com/fmtlib/fmt/pull/1054>`_, 597 `#1063 <https://github.com/fmtlib/fmt/issues/1063>`_, 598 `#1068 <https://github.com/fmtlib/fmt/pull/1068>`_, 599 `#1074 <https://github.com/fmtlib/fmt/pull/1074>`_, 600 `#1075 <https://github.com/fmtlib/fmt/pull/1075>`_, 601 `#1079 <https://github.com/fmtlib/fmt/pull/1079>`_, 602 `#1086 <https://github.com/fmtlib/fmt/pull/1086>`_, 603 `#1088 <https://github.com/fmtlib/fmt/issues/1088>`_, 604 `#1089 <https://github.com/fmtlib/fmt/pull/1089>`_, 605 `#1094 <https://github.com/fmtlib/fmt/pull/1094>`_, 606 `#1101 <https://github.com/fmtlib/fmt/issues/1101>`_, 607 `#1102 <https://github.com/fmtlib/fmt/pull/1102>`_, 608 `#1105 <https://github.com/fmtlib/fmt/issues/1105>`_, 609 `#1107 <https://github.com/fmtlib/fmt/pull/1107>`_, 610 `#1115 <https://github.com/fmtlib/fmt/issues/1115>`_, 611 `#1117 <https://github.com/fmtlib/fmt/issues/1117>`_, 612 `#1118 <https://github.com/fmtlib/fmt/issues/1118>`_, 613 `#1120 <https://github.com/fmtlib/fmt/issues/1120>`_, 614 `#1123 <https://github.com/fmtlib/fmt/issues/1123>`_, 615 `#1139 <https://github.com/fmtlib/fmt/pull/1139>`_, 616 `#1140 <https://github.com/fmtlib/fmt/issues/1140>`_, 617 `#1143 <https://github.com/fmtlib/fmt/issues/1143>`_, 618 `#1144 <https://github.com/fmtlib/fmt/pull/1144>`_, 619 `#1150 <https://github.com/fmtlib/fmt/pull/1150>`_, 620 `#1151 <https://github.com/fmtlib/fmt/pull/1151>`_, 621 `#1152 <https://github.com/fmtlib/fmt/issues/1152>`_, 622 `#1154 <https://github.com/fmtlib/fmt/issues/1154>`_, 623 `#1156 <https://github.com/fmtlib/fmt/issues/1156>`_, 624 `#1159 <https://github.com/fmtlib/fmt/pull/1159>`_, 625 `#1175 <https://github.com/fmtlib/fmt/issues/1175>`_, 626 `#1181 <https://github.com/fmtlib/fmt/issues/1181>`_, 627 `#1186 <https://github.com/fmtlib/fmt/issues/1186>`_, 628 `#1187 <https://github.com/fmtlib/fmt/pull/1187>`_, 629 `#1191 <https://github.com/fmtlib/fmt/pull/1191>`_, 630 `#1197 <https://github.com/fmtlib/fmt/issues/1197>`_, 631 `#1200 <https://github.com/fmtlib/fmt/issues/1200>`_, 632 `#1203 <https://github.com/fmtlib/fmt/issues/1203>`_, 633 `#1205 <https://github.com/fmtlib/fmt/issues/1205>`_, 634 `#1206 <https://github.com/fmtlib/fmt/pull/1206>`_, 635 `#1213 <https://github.com/fmtlib/fmt/issues/1213>`_, 636 `#1214 <https://github.com/fmtlib/fmt/issues/1214>`_, 637 `#1217 <https://github.com/fmtlib/fmt/pull/1217>`_, 638 `#1228 <https://github.com/fmtlib/fmt/issues/1228>`_, 639 `#1230 <https://github.com/fmtlib/fmt/pull/1230>`_, 640 `#1232 <https://github.com/fmtlib/fmt/issues/1232>`_, 641 `#1235 <https://github.com/fmtlib/fmt/pull/1235>`_, 642 `#1236 <https://github.com/fmtlib/fmt/pull/1236>`_, 643 `#1240 <https://github.com/fmtlib/fmt/issues/1240>`_). 644 Thanks `@DanielaE (Daniela Engert) <https://github.com/DanielaE>`_, 645 `@mwinterb <https://github.com/mwinterb>`_, 646 `@eliaskosunen (Elias Kosunen) <https://github.com/eliaskosunen>`_, 647 `@morinmorin <https://github.com/morinmorin>`_, 648 `@ricco19 (Brian Ricciardelli) <https://github.com/ricco19>`_, 649 `@waywardmonkeys (Bruce Mitchener) <https://github.com/waywardmonkeys>`_, 650 `@chronoxor (Ivan Shynkarenka) <https://github.com/chronoxor>`_, 651 `@remyabel <https://github.com/remyabel>`_, 652 `@pauldreik (Paul Dreik) <https://github.com/pauldreik>`_, 653 `@gsjaardema (Greg Sjaardema) <https://github.com/gsjaardema>`_, 654 `@rcane (Ronny Krüger) <https://github.com/rcane>`_, 655 `@mocabe <https://github.com/mocabe>`_, 656 `@denchat <https://github.com/denchat>`_, 657 `@cjdb (Christopher Di Bella) <https://github.com/cjdb>`_, 658 `@HazardyKnusperkeks (Björn Schäpers) <https://github.com/HazardyKnusperkeks>`_, 659 `@vedranmiletic (Vedran Miletić) <https://github.com/vedranmiletic>`_, 660 `@jackoalan (Jack Andersen) <https://github.com/jackoalan>`_, 661 `@DaanDeMeyer (Daan De Meyer) <https://github.com/DaanDeMeyer>`_, 662 `@starkmapper (Mark Stapper) <https://github.com/starkmapper>`_. 663 6645.3.0 - 2018-12-28 665------------------ 666 667* Introduced experimental chrono formatting support: 668 669 .. code:: c++ 670 671 #include <fmt/chrono.h> 672 673 int main() { 674 using namespace std::literals::chrono_literals; 675 fmt::print("Default format: {} {}\n", 42s, 100ms); 676 fmt::print("strftime-like format: {:%H:%M:%S}\n", 3h + 15min + 30s); 677 } 678 679 prints:: 680 681 Default format: 42s 100ms 682 strftime-like format: 03:15:30 683 684* Added experimental support for emphasis (bold, italic, underline, 685 strikethrough), colored output to a file stream, and improved colored 686 formatting API 687 (`#961 <https://github.com/fmtlib/fmt/pull/961>`_, 688 `#967 <https://github.com/fmtlib/fmt/pull/967>`_, 689 `#973 <https://github.com/fmtlib/fmt/pull/973>`_): 690 691 .. code:: c++ 692 693 #include <fmt/color.h> 694 695 int main() { 696 print(fg(fmt::color::crimson) | fmt::emphasis::bold, 697 "Hello, {}!\n", "world"); 698 print(fg(fmt::color::floral_white) | bg(fmt::color::slate_gray) | 699 fmt::emphasis::underline, "Hello, {}!\n", "мир"); 700 print(fg(fmt::color::steel_blue) | fmt::emphasis::italic, 701 "Hello, {}!\n", "世界"); 702 } 703 704 prints the following on modern terminals with RGB color support: 705 706 .. image:: https://user-images.githubusercontent.com/576385/ 707 50405788-b66e7500-076e-11e9-9592-7324d1f951d8.png 708 709 Thanks `@Rakete1111 (Nicolas) <https://github.com/Rakete1111>`_. 710 711* Added support for 4-bit terminal colors 712 (`#968 <https://github.com/fmtlib/fmt/issues/968>`_, 713 `#974 <https://github.com/fmtlib/fmt/pull/974>`_) 714 715 .. code:: c++ 716 717 #include <fmt/color.h> 718 719 int main() { 720 print(fg(fmt::terminal_color::red), "stop\n"); 721 } 722 723 Note that these colors vary by terminal: 724 725 .. image:: https://user-images.githubusercontent.com/576385/ 726 50405925-dbfc7e00-0770-11e9-9b85-333fab0af9ac.png 727 728 Thanks `@Rakete1111 (Nicolas) <https://github.com/Rakete1111>`_. 729 730* Parameterized formatting functions on the type of the format string 731 (`#880 <https://github.com/fmtlib/fmt/issues/880>`_, 732 `#881 <https://github.com/fmtlib/fmt/pull/881>`_, 733 `#883 <https://github.com/fmtlib/fmt/pull/883>`_, 734 `#885 <https://github.com/fmtlib/fmt/pull/885>`_, 735 `#897 <https://github.com/fmtlib/fmt/pull/897>`_, 736 `#920 <https://github.com/fmtlib/fmt/issues/920>`_). 737 Any object of type ``S`` that has an overloaded ``to_string_view(const S&)`` 738 returning ``fmt::string_view`` can be used as a format string: 739 740 .. code:: c++ 741 742 namespace my_ns { 743 inline string_view to_string_view(const my_string& s) { 744 return {s.data(), s.length()}; 745 } 746 } 747 748 std::string message = fmt::format(my_string("The answer is {}."), 42); 749 750 Thanks `@DanielaE (Daniela Engert) <https://github.com/DanielaE>`_. 751 752* Made ``std::string_view`` work as a format string 753 (`#898 <https://github.com/fmtlib/fmt/pull/898>`_): 754 755 .. code:: c++ 756 757 auto message = fmt::format(std::string_view("The answer is {}."), 42); 758 759 Thanks `@DanielaE (Daniela Engert) <https://github.com/DanielaE>`_. 760 761* Added wide string support to compile-time format string checks 762 (`#924 <https://github.com/fmtlib/fmt/pull/924>`_): 763 764 .. code:: c++ 765 766 print(fmt(L"{:f}"), 42); // compile-time error: invalid type specifier 767 768 Thanks `@XZiar <https://github.com/XZiar>`_. 769 770* Made colored print functions work with wide strings 771 (`#867 <https://github.com/fmtlib/fmt/pull/867>`_): 772 773 .. code:: c++ 774 775 #include <fmt/color.h> 776 777 int main() { 778 print(fg(fmt::color::red), L"{}\n", 42); 779 } 780 781 Thanks `@DanielaE (Daniela Engert) <https://github.com/DanielaE>`_. 782 783* Introduced experimental Unicode support 784 (`#628 <https://github.com/fmtlib/fmt/issues/628>`_, 785 `#891 <https://github.com/fmtlib/fmt/pull/891>`_): 786 787 .. code:: c++ 788 789 using namespace fmt::literals; 790 auto s = fmt::format("{:*^5}"_u, ""_u); // s == "****"_u 791 792* Improved locale support: 793 794 .. code:: c++ 795 796 #include <fmt/locale.h> 797 798 struct numpunct : std::numpunct<char> { 799 protected: 800 char do_thousands_sep() const override { return '~'; } 801 }; 802 803 std::locale loc; 804 auto s = fmt::format(std::locale(loc, new numpunct()), "{:n}", 1234567); 805 // s == "1~234~567" 806 807* Constrained formatting functions on proper iterator types 808 (`#921 <https://github.com/fmtlib/fmt/pull/921>`_). 809 Thanks `@DanielaE (Daniela Engert) <https://github.com/DanielaE>`_. 810 811* Added ``make_printf_args`` and ``make_wprintf_args`` functions 812 (`#934 <https://github.com/fmtlib/fmt/pull/934>`_). 813 Thanks `@tnovotny <https://github.com/tnovotny>`_. 814 815* Deprecated ``fmt::visit``, ``parse_context``, and ``wparse_context``. 816 Use ``fmt::visit_format_arg``, ``format_parse_context``, and 817 ``wformat_parse_context`` instead. 818 819* Removed undocumented ``basic_fixed_buffer`` which has been superseded by the 820 iterator-based API 821 (`#873 <https://github.com/fmtlib/fmt/issues/873>`_, 822 `#902 <https://github.com/fmtlib/fmt/pull/902>`_). 823 Thanks `@superfunc (hollywood programmer) <https://github.com/superfunc>`_. 824 825* Disallowed repeated leading zeros in an argument ID: 826 827 .. code:: c++ 828 829 fmt::print("{000}", 42); // error 830 831* Reintroduced support for gcc 4.4. 832 833* Fixed compilation on platforms with exotic ``double`` 834 (`#878 <https://github.com/fmtlib/fmt/issues/878>`_). 835 836* Improved documentation 837 (`#164 <https://github.com/fmtlib/fmt/issues/164>`_, 838 `#877 <https://github.com/fmtlib/fmt/issues/877>`_, 839 `#901 <https://github.com/fmtlib/fmt/pull/901>`_, 840 `#906 <https://github.com/fmtlib/fmt/pull/906>`_, 841 `#979 <https://github.com/fmtlib/fmt/pull/979>`_). 842 Thanks `@kookjr (Mathew Cucuzella) <https://github.com/kookjr>`_, 843 `@DarkDimius (Dmitry Petrashko) <https://github.com/DarkDimius>`_, 844 `@HecticSerenity <https://github.com/HecticSerenity>`_. 845 846* Added pkgconfig support which makes it easier to consume the library from 847 meson and other build systems 848 (`#916 <https://github.com/fmtlib/fmt/pull/916>`_). 849 Thanks `@colemickens (Cole Mickens) <https://github.com/colemickens>`_. 850 851* Various build improvements 852 (`#909 <https://github.com/fmtlib/fmt/pull/909>`_, 853 `#926 <https://github.com/fmtlib/fmt/pull/926>`_, 854 `#937 <https://github.com/fmtlib/fmt/pull/937>`_, 855 `#953 <https://github.com/fmtlib/fmt/pull/953>`_, 856 `#959 <https://github.com/fmtlib/fmt/pull/959>`_). 857 Thanks `@tchaikov (Kefu Chai) <https://github.com/tchaikov>`_, 858 `@luncliff (Park DongHa) <https://github.com/luncliff>`_, 859 `@AndreasSchoenle (Andreas Schönle) <https://github.com/AndreasSchoenle>`_, 860 `@hotwatermorning <https://github.com/hotwatermorning>`_, 861 `@Zefz (JohanJansen) <https://github.com/Zefz>`_. 862 863* Improved ``string_view`` construction performance 864 (`#914 <https://github.com/fmtlib/fmt/pull/914>`_). 865 Thanks `@gabime (Gabi Melman) <https://github.com/gabime>`_. 866 867* Fixed non-matching char types 868 (`#895 <https://github.com/fmtlib/fmt/pull/895>`_). 869 Thanks `@DanielaE (Daniela Engert) <https://github.com/DanielaE>`_. 870 871* Fixed ``format_to_n`` with ``std::back_insert_iterator`` 872 (`#913 <https://github.com/fmtlib/fmt/pull/913>`_). 873 Thanks `@DanielaE (Daniela Engert) <https://github.com/DanielaE>`_. 874 875* Fixed locale-dependent formatting 876 (`#905 <https://github.com/fmtlib/fmt/issues/905>`_). 877 878* Fixed various compiler warnings and errors 879 (`#882 <https://github.com/fmtlib/fmt/pull/882>`_, 880 `#886 <https://github.com/fmtlib/fmt/pull/886>`_, 881 `#933 <https://github.com/fmtlib/fmt/pull/933>`_, 882 `#941 <https://github.com/fmtlib/fmt/pull/941>`_, 883 `#931 <https://github.com/fmtlib/fmt/issues/931>`_, 884 `#943 <https://github.com/fmtlib/fmt/pull/943>`_, 885 `#954 <https://github.com/fmtlib/fmt/pull/954>`_, 886 `#956 <https://github.com/fmtlib/fmt/pull/956>`_, 887 `#962 <https://github.com/fmtlib/fmt/pull/962>`_, 888 `#965 <https://github.com/fmtlib/fmt/issues/965>`_, 889 `#977 <https://github.com/fmtlib/fmt/issues/977>`_, 890 `#983 <https://github.com/fmtlib/fmt/pull/983>`_, 891 `#989 <https://github.com/fmtlib/fmt/pull/989>`_). 892 Thanks `@Luthaf (Guillaume Fraux) <https://github.com/Luthaf>`_, 893 `@stevenhoving (Steven Hoving) <https://github.com/stevenhoving>`_, 894 `@christinaa (Kristina Brooks) <https://github.com/christinaa>`_, 895 `@lgritz (Larry Gritz) <https://github.com/lgritz>`_, 896 `@DanielaE (Daniela Engert) <https://github.com/DanielaE>`_, 897 `@0x8000-0000 (Sign Bit) <https://github.com/0x8000-0000>`_, 898 `@liuping1997 <https://github.com/liuping1997>`_. 899 9005.2.1 - 2018-09-21 901------------------ 902 903* Fixed ``visit`` lookup issues on gcc 7 & 8 904 (`#870 <https://github.com/fmtlib/fmt/pull/870>`_). 905 Thanks `@medithe <https://github.com/medithe>`_. 906 907* Fixed linkage errors on older gcc. 908 909* Prevented ``fmt/range.h`` from specializing ``fmt::basic_string_view`` 910 (`#865 <https://github.com/fmtlib/fmt/issues/865>`_, 911 `#868 <https://github.com/fmtlib/fmt/pull/868>`_). 912 Thanks `@hhggit (dual) <https://github.com/hhggit>`_. 913 914* Improved error message when formatting unknown types 915 (`#872 <https://github.com/fmtlib/fmt/pull/872>`_). 916 Thanks `@foonathan (Jonathan Müller) <https://github.com/foonathan>`_, 917 918* Disabled templated user-defined literals when compiled under nvcc 919 (`#875 <https://github.com/fmtlib/fmt/pull/875>`_). 920 Thanks `@CandyGumdrop (Candy Gumdrop) <https://github.com/CandyGumdrop>`_, 921 922* Fixed ``format_to`` formatting to ``wmemory_buffer`` 923 (`#874 <https://github.com/fmtlib/fmt/issues/874>`_). 924 9255.2.0 - 2018-09-13 926------------------ 927 928* Optimized format string parsing and argument processing which resulted in up 929 to 5x speed up on long format strings and significant performance boost on 930 various benchmarks. For example, version 5.2 is 2.22x faster than 5.1 on 931 decimal integer formatting with ``format_to`` (macOS, clang-902.0.39.2): 932 933 ================== ======= ======= 934 Method Time, s Speedup 935 ================== ======= ======= 936 fmt::format 5.1 0.58 937 fmt::format 5.2 0.35 1.66x 938 fmt::format_to 5.1 0.51 939 fmt::format_to 5.2 0.23 2.22x 940 sprintf 0.71 941 std::to_string 1.01 942 std::stringstream 1.73 943 ================== ======= ======= 944 945* Changed the ``fmt`` macro from opt-out to opt-in to prevent name collisions. 946 To enable it define the ``FMT_STRING_ALIAS`` macro to 1 before including 947 ``fmt/format.h``: 948 949 .. code:: c++ 950 951 #define FMT_STRING_ALIAS 1 952 #include <fmt/format.h> 953 std::string answer = format(fmt("{}"), 42); 954 955* Added compile-time format string checks to ``format_to`` overload that takes 956 ``fmt::memory_buffer`` (`#783 <https://github.com/fmtlib/fmt/issues/783>`_): 957 958 .. code:: c++ 959 960 fmt::memory_buffer buf; 961 // Compile-time error: invalid type specifier. 962 fmt::format_to(buf, fmt("{:d}"), "foo"); 963 964* Moved experimental color support to ``fmt/color.h`` and enabled the 965 new API by default. The old API can be enabled by defining the 966 ``FMT_DEPRECATED_COLORS`` macro. 967 968* Added formatting support for types explicitly convertible to 969 ``fmt::string_view``: 970 971 .. code:: c++ 972 973 struct foo { 974 explicit operator fmt::string_view() const { return "foo"; } 975 }; 976 auto s = format("{}", foo()); 977 978 In particular, this makes formatting function work with 979 ``folly::StringPiece``. 980 981* Implemented preliminary support for ``char*_t`` by replacing the ``format`` 982 function overloads with a single function template parameterized on the string 983 type. 984 985* Added support for dynamic argument lists 986 (`#814 <https://github.com/fmtlib/fmt/issues/814>`_, 987 `#819 <https://github.com/fmtlib/fmt/pull/819>`_). 988 Thanks `@MikePopoloski (Michael Popoloski) 989 <https://github.com/MikePopoloski>`_. 990 991* Reduced executable size overhead for embedded targets using newlib nano by 992 making locale dependency optional 993 (`#839 <https://github.com/fmtlib/fmt/pull/839>`_). 994 Thanks `@teajay-fr (Thomas Benard) <https://github.com/teajay-fr>`_. 995 996* Keep ``noexcept`` specifier when exceptions are disabled 997 (`#801 <https://github.com/fmtlib/fmt/issues/801>`_, 998 `#810 <https://github.com/fmtlib/fmt/pull/810>`_). 999 Thanks `@qis (Alexej Harm) <https://github.com/qis>`_. 1000 1001* Fixed formatting of user-defined types providing ``operator<<`` with 1002 ``format_to_n`` 1003 (`#806 <https://github.com/fmtlib/fmt/pull/806>`_). 1004 Thanks `@mkurdej (Marek Kurdej) <https://github.com/mkurdej>`_. 1005 1006* Fixed dynamic linkage of new symbols 1007 (`#808 <https://github.com/fmtlib/fmt/issues/808>`_). 1008 1009* Fixed global initialization issue 1010 (`#807 <https://github.com/fmtlib/fmt/issues/807>`_): 1011 1012 .. code:: c++ 1013 1014 // This works on compilers with constexpr support. 1015 static const std::string answer = fmt::format("{}", 42); 1016 1017* Fixed various compiler warnings and errors 1018 (`#804 <https://github.com/fmtlib/fmt/pull/804>`_, 1019 `#809 <https://github.com/fmtlib/fmt/issues/809>`_, 1020 `#811 <https://github.com/fmtlib/fmt/pull/811>`_, 1021 `#822 <https://github.com/fmtlib/fmt/issues/822>`_, 1022 `#827 <https://github.com/fmtlib/fmt/pull/827>`_, 1023 `#830 <https://github.com/fmtlib/fmt/issues/830>`_, 1024 `#838 <https://github.com/fmtlib/fmt/pull/838>`_, 1025 `#843 <https://github.com/fmtlib/fmt/issues/843>`_, 1026 `#844 <https://github.com/fmtlib/fmt/pull/844>`_, 1027 `#851 <https://github.com/fmtlib/fmt/issues/851>`_, 1028 `#852 <https://github.com/fmtlib/fmt/pull/852>`_, 1029 `#854 <https://github.com/fmtlib/fmt/pull/854>`_). 1030 Thanks `@henryiii (Henry Schreiner) <https://github.com/henryiii>`_, 1031 `@medithe <https://github.com/medithe>`_, and 1032 `@eliasdaler (Elias Daler) <https://github.com/eliasdaler>`_. 1033 10345.1.0 - 2018-07-05 1035------------------ 1036 1037* Added experimental support for RGB color output enabled with 1038 the ``FMT_EXTENDED_COLORS`` macro: 1039 1040 .. code:: c++ 1041 1042 #define FMT_EXTENDED_COLORS 1043 #define FMT_HEADER_ONLY // or compile fmt with FMT_EXTENDED_COLORS defined 1044 #include <fmt/format.h> 1045 1046 fmt::print(fmt::color::steel_blue, "Some beautiful text"); 1047 1048 The old API (the ``print_colored`` and ``vprint_colored`` functions and the 1049 ``color`` enum) is now deprecated. 1050 (`#762 <https://github.com/fmtlib/fmt/issues/762>`_ 1051 `#767 <https://github.com/fmtlib/fmt/pull/767>`_). 1052 thanks `@Remotion (Remo) <https://github.com/Remotion>`_. 1053 1054* Added quotes to strings in ranges and tuples 1055 (`#766 <https://github.com/fmtlib/fmt/pull/766>`_). 1056 Thanks `@Remotion (Remo) <https://github.com/Remotion>`_. 1057 1058* Made ``format_to`` work with ``basic_memory_buffer`` 1059 (`#776 <https://github.com/fmtlib/fmt/issues/776>`_). 1060 1061* Added ``vformat_to_n`` and ``wchar_t`` overload of ``format_to_n`` 1062 (`#764 <https://github.com/fmtlib/fmt/issues/764>`_, 1063 `#769 <https://github.com/fmtlib/fmt/issues/769>`_). 1064 1065* Made ``is_range`` and ``is_tuple_like`` part of public (experimental) API 1066 to allow specialization for user-defined types 1067 (`#751 <https://github.com/fmtlib/fmt/issues/751>`_, 1068 `#759 <https://github.com/fmtlib/fmt/pull/759>`_). 1069 Thanks `@drrlvn (Dror Levin) <https://github.com/drrlvn>`_. 1070 1071* Added more compilers to continuous integration and increased ``FMT_PEDANTIC`` 1072 warning levels 1073 (`#736 <https://github.com/fmtlib/fmt/pull/736>`_). 1074 Thanks `@eliaskosunen (Elias Kosunen) <https://github.com/eliaskosunen>`_. 1075 1076* Fixed compilation with MSVC 2013. 1077 1078* Fixed handling of user-defined types in ``format_to`` 1079 (`#793 <https://github.com/fmtlib/fmt/issues/793>`_). 1080 1081* Forced linking of inline ``vformat`` functions into the library 1082 (`#795 <https://github.com/fmtlib/fmt/issues/795>`_). 1083 1084* Fixed incorrect call to on_align in ``'{:}='`` 1085 (`#750 <https://github.com/fmtlib/fmt/issues/750>`_). 1086 1087* Fixed floating-point formatting to a non-back_insert_iterator with sign & 1088 numeric alignment specified 1089 (`#756 <https://github.com/fmtlib/fmt/issues/756>`_). 1090 1091* Fixed formatting to an array with ``format_to_n`` 1092 (`#778 <https://github.com/fmtlib/fmt/issues/778>`_). 1093 1094* Fixed formatting of more than 15 named arguments 1095 (`#754 <https://github.com/fmtlib/fmt/issues/754>`_). 1096 1097* Fixed handling of compile-time strings when including ``fmt/ostream.h``. 1098 (`#768 <https://github.com/fmtlib/fmt/issues/768>`_). 1099 1100* Fixed various compiler warnings and errors 1101 (`#742 <https://github.com/fmtlib/fmt/issues/742>`_, 1102 `#748 <https://github.com/fmtlib/fmt/issues/748>`_, 1103 `#752 <https://github.com/fmtlib/fmt/issues/752>`_, 1104 `#770 <https://github.com/fmtlib/fmt/issues/770>`_, 1105 `#775 <https://github.com/fmtlib/fmt/pull/775>`_, 1106 `#779 <https://github.com/fmtlib/fmt/issues/779>`_, 1107 `#780 <https://github.com/fmtlib/fmt/pull/780>`_, 1108 `#790 <https://github.com/fmtlib/fmt/pull/790>`_, 1109 `#792 <https://github.com/fmtlib/fmt/pull/792>`_, 1110 `#800 <https://github.com/fmtlib/fmt/pull/800>`_). 1111 Thanks `@Remotion (Remo) <https://github.com/Remotion>`_, 1112 `@gabime (Gabi Melman) <https://github.com/gabime>`_, 1113 `@foonathan (Jonathan Müller) <https://github.com/foonathan>`_, 1114 `@Dark-Passenger (Dhruv Paranjape) <https://github.com/Dark-Passenger>`_, and 1115 `@0x8000-0000 (Sign Bit) <https://github.com/0x8000-0000>`_. 1116 11175.0.0 - 2018-05-21 1118------------------ 1119 1120* Added a requirement for partial C++11 support, most importantly variadic 1121 templates and type traits, and dropped ``FMT_VARIADIC_*`` emulation macros. 1122 Variadic templates are available since GCC 4.4, Clang 2.9 and MSVC 18.0 (2013). 1123 For older compilers use {fmt} `version 4.x 1124 <https://github.com/fmtlib/fmt/releases/tag/4.1.0>`_ which continues to be 1125 maintained and works with C++98 compilers. 1126 1127* Renamed symbols to follow standard C++ naming conventions and proposed a subset 1128 of the library for standardization in `P0645R2 Text Formatting 1129 <https://wg21.link/P0645>`_. 1130 1131* Implemented ``constexpr`` parsing of format strings and `compile-time format 1132 string checks 1133 <https://fmt.dev/dev/api.html#compile-time-format-string-checks>`_. For 1134 example 1135 1136 .. code:: c++ 1137 1138 #include <fmt/format.h> 1139 1140 std::string s = format(fmt("{:d}"), "foo"); 1141 1142 gives a compile-time error because ``d`` is an invalid specifier for strings 1143 (`godbolt <https://godbolt.org/g/rnCy9Q>`__):: 1144 1145 ... 1146 <source>:4:19: note: in instantiation of function template specialization 'fmt::v5::format<S, char [4]>' requested here 1147 std::string s = format(fmt("{:d}"), "foo"); 1148 ^ 1149 format.h:1337:13: note: non-constexpr function 'on_error' cannot be used in a constant expression 1150 handler.on_error("invalid type specifier"); 1151 1152 Compile-time checks require relaxed ``constexpr`` (C++14 feature) support. If 1153 the latter is not available, checks will be performed at runtime. 1154 1155* Separated format string parsing and formatting in the extension API to enable 1156 compile-time format string processing. For example 1157 1158 .. code:: c++ 1159 1160 struct Answer {}; 1161 1162 namespace fmt { 1163 template <> 1164 struct formatter<Answer> { 1165 constexpr auto parse(parse_context& ctx) { 1166 auto it = ctx.begin(); 1167 spec = *it; 1168 if (spec != 'd' && spec != 's') 1169 throw format_error("invalid specifier"); 1170 return ++it; 1171 } 1172 1173 template <typename FormatContext> 1174 auto format(Answer, FormatContext& ctx) { 1175 return spec == 's' ? 1176 format_to(ctx.begin(), "{}", "fourty-two") : 1177 format_to(ctx.begin(), "{}", 42); 1178 } 1179 1180 char spec = 0; 1181 }; 1182 } 1183 1184 std::string s = format(fmt("{:x}"), Answer()); 1185 1186 gives a compile-time error due to invalid format specifier (`godbolt 1187 <https://godbolt.org/g/2jQ1Dv>`__):: 1188 1189 ... 1190 <source>:12:45: error: expression '<throw-expression>' is not a constant expression 1191 throw format_error("invalid specifier"); 1192 1193* Added `iterator support 1194 <https://fmt.dev/dev/api.html#output-iterator-support>`_: 1195 1196 .. code:: c++ 1197 1198 #include <vector> 1199 #include <fmt/format.h> 1200 1201 std::vector<char> out; 1202 fmt::format_to(std::back_inserter(out), "{}", 42); 1203 1204* Added the `format_to_n 1205 <https://fmt.dev/dev/api.html#_CPPv2N3fmt11format_to_nE8OutputItNSt6size_tE11string_viewDpRK4Args>`_ 1206 function that restricts the output to the specified number of characters 1207 (`#298 <https://github.com/fmtlib/fmt/issues/298>`_): 1208 1209 .. code:: c++ 1210 1211 char out[4]; 1212 fmt::format_to_n(out, sizeof(out), "{}", 12345); 1213 // out == "1234" (without terminating '\0') 1214 1215* Added the `formatted_size 1216 <https://fmt.dev/dev/api.html#_CPPv2N3fmt14formatted_sizeE11string_viewDpRK4Args>`_ 1217 function for computing the output size: 1218 1219 .. code:: c++ 1220 1221 #include <fmt/format.h> 1222 1223 auto size = fmt::formatted_size("{}", 12345); // size == 5 1224 1225* Improved compile times by reducing dependencies on standard headers and 1226 providing a lightweight `core API <https://fmt.dev/dev/api.html#core-api>`_: 1227 1228 .. code:: c++ 1229 1230 #include <fmt/core.h> 1231 1232 fmt::print("The answer is {}.", 42); 1233 1234 See `Compile time and code bloat 1235 <https://github.com/fmtlib/fmt#compile-time-and-code-bloat>`_. 1236 1237* Added the `make_format_args 1238 <https://fmt.dev/dev/api.html#_CPPv2N3fmt16make_format_argsEDpRK4Args>`_ 1239 function for capturing formatting arguments: 1240 1241 .. code:: c++ 1242 1243 // Prints formatted error message. 1244 void vreport_error(const char *format, fmt::format_args args) { 1245 fmt::print("Error: "); 1246 fmt::vprint(format, args); 1247 } 1248 template <typename... Args> 1249 void report_error(const char *format, const Args & ... args) { 1250 vreport_error(format, fmt::make_format_args(args...)); 1251 } 1252 1253* Added the ``make_printf_args`` function for capturing ``printf`` arguments 1254 (`#687 <https://github.com/fmtlib/fmt/issues/687>`_, 1255 `#694 <https://github.com/fmtlib/fmt/pull/694>`_). 1256 Thanks `@Kronuz (Germán Méndez Bravo) <https://github.com/Kronuz>`_. 1257 1258* Added prefix ``v`` to non-variadic functions taking ``format_args`` to 1259 distinguish them from variadic ones: 1260 1261 .. code:: c++ 1262 1263 std::string vformat(string_view format_str, format_args args); 1264 1265 template <typename... Args> 1266 std::string format(string_view format_str, const Args & ... args); 1267 1268* Added experimental support for formatting ranges, containers and tuple-like 1269 types in ``fmt/ranges.h`` (`#735 <https://github.com/fmtlib/fmt/pull/735>`_): 1270 1271 .. code:: c++ 1272 1273 #include <fmt/ranges.h> 1274 1275 std::vector<int> v = {1, 2, 3}; 1276 fmt::print("{}", v); // prints {1, 2, 3} 1277 1278 Thanks `@Remotion (Remo) <https://github.com/Remotion>`_. 1279 1280* Implemented ``wchar_t`` date and time formatting 1281 (`#712 <https://github.com/fmtlib/fmt/pull/712>`_): 1282 1283 .. code:: c++ 1284 1285 #include <fmt/time.h> 1286 1287 std::time_t t = std::time(nullptr); 1288 auto s = fmt::format(L"The date is {:%Y-%m-%d}.", *std::localtime(&t)); 1289 1290 Thanks `@DanielaE (Daniela Engert) <https://github.com/DanielaE>`_. 1291 1292* Provided more wide string overloads 1293 (`#724 <https://github.com/fmtlib/fmt/pull/724>`_). 1294 Thanks `@DanielaE (Daniela Engert) <https://github.com/DanielaE>`_. 1295 1296* Switched from a custom null-terminated string view class to ``string_view`` 1297 in the format API and provided ``fmt::string_view`` which implements a subset 1298 of ``std::string_view`` API for pre-C++17 systems. 1299 1300* Added support for ``std::experimental::string_view`` 1301 (`#607 <https://github.com/fmtlib/fmt/pull/607>`_): 1302 1303 .. code:: c++ 1304 1305 #include <fmt/core.h> 1306 #include <experimental/string_view> 1307 1308 fmt::print("{}", std::experimental::string_view("foo")); 1309 1310 Thanks `@virgiliofornazin (Virgilio Alexandre Fornazin) 1311 <https://github.com/virgiliofornazin>`__. 1312 1313* Allowed mixing named and automatic arguments: 1314 1315 .. code:: c++ 1316 1317 fmt::format("{} {two}", 1, fmt::arg("two", 2)); 1318 1319* Removed the write API in favor of the `format API 1320 <https://fmt.dev/dev/api.html#format-api>`_ with compile-time handling of 1321 format strings. 1322 1323* Disallowed formatting of multibyte strings into a wide character target 1324 (`#606 <https://github.com/fmtlib/fmt/pull/606>`_). 1325 1326* Improved documentation 1327 (`#515 <https://github.com/fmtlib/fmt/pull/515>`_, 1328 `#614 <https://github.com/fmtlib/fmt/issues/614>`_, 1329 `#617 <https://github.com/fmtlib/fmt/pull/617>`_, 1330 `#661 <https://github.com/fmtlib/fmt/pull/661>`_, 1331 `#680 <https://github.com/fmtlib/fmt/pull/680>`_). 1332 Thanks `@ibell (Ian Bell) <https://github.com/ibell>`_, 1333 `@mihaitodor (Mihai Todor) <https://github.com/mihaitodor>`_, and 1334 `@johnthagen <https://github.com/johnthagen>`_. 1335 1336* Implemented more efficient handling of large number of format arguments. 1337 1338* Introduced an inline namespace for symbol versioning. 1339 1340* Added debug postfix ``d`` to the ``fmt`` library name 1341 (`#636 <https://github.com/fmtlib/fmt/issues/636>`_). 1342 1343* Removed unnecessary ``fmt/`` prefix in includes 1344 (`#397 <https://github.com/fmtlib/fmt/pull/397>`_). 1345 Thanks `@chronoxor (Ivan Shynkarenka) <https://github.com/chronoxor>`_. 1346 1347* Moved ``fmt/*.h`` to ``include/fmt/*.h`` to prevent irrelevant files and 1348 directories appearing on the include search paths when fmt is used as a 1349 subproject and moved source files to the ``src`` directory. 1350 1351* Added qmake project file ``support/fmt.pro`` 1352 (`#641 <https://github.com/fmtlib/fmt/pull/641>`_). 1353 Thanks `@cowo78 (Giuseppe Corbelli) <https://github.com/cowo78>`_. 1354 1355* Added Gradle build file ``support/build.gradle`` 1356 (`#649 <https://github.com/fmtlib/fmt/pull/649>`_). 1357 Thanks `@luncliff (Park DongHa) <https://github.com/luncliff>`_. 1358 1359* Removed ``FMT_CPPFORMAT`` CMake option. 1360 1361* Fixed a name conflict with the macro ``CHAR_WIDTH`` in glibc 1362 (`#616 <https://github.com/fmtlib/fmt/pull/616>`_). 1363 Thanks `@aroig (Abdó Roig-Maranges) <https://github.com/aroig>`_. 1364 1365* Fixed handling of nested braces in ``fmt::join`` 1366 (`#638 <https://github.com/fmtlib/fmt/issues/638>`_). 1367 1368* Added ``SOURCELINK_SUFFIX`` for compatibility with Sphinx 1.5 1369 (`#497 <https://github.com/fmtlib/fmt/pull/497>`_). 1370 Thanks `@ginggs (Graham Inggs) <https://github.com/ginggs>`_. 1371 1372* Added a missing ``inline`` in the header-only mode 1373 (`#626 <https://github.com/fmtlib/fmt/pull/626>`_). 1374 Thanks `@aroig (Abdó Roig-Maranges) <https://github.com/aroig>`_. 1375 1376* Fixed various compiler warnings 1377 (`#640 <https://github.com/fmtlib/fmt/pull/640>`_, 1378 `#656 <https://github.com/fmtlib/fmt/pull/656>`_, 1379 `#679 <https://github.com/fmtlib/fmt/pull/679>`_, 1380 `#681 <https://github.com/fmtlib/fmt/pull/681>`_, 1381 `#705 <https://github.com/fmtlib/fmt/pull/705>`__, 1382 `#715 <https://github.com/fmtlib/fmt/issues/715>`_, 1383 `#717 <https://github.com/fmtlib/fmt/pull/717>`_, 1384 `#720 <https://github.com/fmtlib/fmt/pull/720>`_, 1385 `#723 <https://github.com/fmtlib/fmt/pull/723>`_, 1386 `#726 <https://github.com/fmtlib/fmt/pull/726>`_, 1387 `#730 <https://github.com/fmtlib/fmt/pull/730>`_, 1388 `#739 <https://github.com/fmtlib/fmt/pull/739>`_). 1389 Thanks `@peterbell10 <https://github.com/peterbell10>`_, 1390 `@LarsGullik <https://github.com/LarsGullik>`_, 1391 `@foonathan (Jonathan Müller) <https://github.com/foonathan>`_, 1392 `@eliaskosunen (Elias Kosunen) <https://github.com/eliaskosunen>`_, 1393 `@christianparpart (Christian Parpart) <https://github.com/christianparpart>`_, 1394 `@DanielaE (Daniela Engert) <https://github.com/DanielaE>`_, 1395 and `@mwinterb <https://github.com/mwinterb>`_. 1396 1397* Worked around an MSVC bug and fixed several warnings 1398 (`#653 <https://github.com/fmtlib/fmt/pull/653>`_). 1399 Thanks `@alabuzhev (Alex Alabuzhev) <https://github.com/alabuzhev>`_. 1400 1401* Worked around GCC bug 67371 1402 (`#682 <https://github.com/fmtlib/fmt/issues/682>`_). 1403 1404* Fixed compilation with ``-fno-exceptions`` 1405 (`#655 <https://github.com/fmtlib/fmt/pull/655>`_). 1406 Thanks `@chenxiaolong (Andrew Gunnerson) <https://github.com/chenxiaolong>`_. 1407 1408* Made ``constexpr remove_prefix`` gcc version check tighter 1409 (`#648 <https://github.com/fmtlib/fmt/issues/648>`_). 1410 1411* Renamed internal type enum constants to prevent collision with poorly written 1412 C libraries (`#644 <https://github.com/fmtlib/fmt/issues/644>`_). 1413 1414* Added detection of ``wostream operator<<`` 1415 (`#650 <https://github.com/fmtlib/fmt/issues/650>`_). 1416 1417* Fixed compilation on OpenBSD 1418 (`#660 <https://github.com/fmtlib/fmt/pull/660>`_). 1419 Thanks `@hubslave <https://github.com/hubslave>`_. 1420 1421* Fixed compilation on FreeBSD 12 1422 (`#732 <https://github.com/fmtlib/fmt/pull/732>`_). 1423 Thanks `@dankm <https://github.com/dankm>`_. 1424 1425* Fixed compilation when there is a mismatch between ``-std`` options between 1426 the library and user code 1427 (`#664 <https://github.com/fmtlib/fmt/issues/664>`_). 1428 1429* Fixed compilation with GCC 7 and ``-std=c++11`` 1430 (`#734 <https://github.com/fmtlib/fmt/issues/734>`_). 1431 1432* Improved generated binary code on GCC 7 and older 1433 (`#668 <https://github.com/fmtlib/fmt/issues/668>`_). 1434 1435* Fixed handling of numeric alignment with no width 1436 (`#675 <https://github.com/fmtlib/fmt/issues/675>`_). 1437 1438* Fixed handling of empty strings in UTF8/16 converters 1439 (`#676 <https://github.com/fmtlib/fmt/pull/676>`_). 1440 Thanks `@vgalka-sl (Vasili Galka) <https://github.com/vgalka-sl>`_. 1441 1442* Fixed formatting of an empty ``string_view`` 1443 (`#689 <https://github.com/fmtlib/fmt/issues/689>`_). 1444 1445* Fixed detection of ``string_view`` on libc++ 1446 (`#686 <https://github.com/fmtlib/fmt/issues/686>`_). 1447 1448* Fixed DLL issues (`#696 <https://github.com/fmtlib/fmt/pull/696>`_). 1449 Thanks `@sebkoenig <https://github.com/sebkoenig>`_. 1450 1451* Fixed compile checks for mixing narrow and wide strings 1452 (`#690 <https://github.com/fmtlib/fmt/issues/690>`_). 1453 1454* Disabled unsafe implicit conversion to ``std::string`` 1455 (`#729 <https://github.com/fmtlib/fmt/issues/729>`_). 1456 1457* Fixed handling of reused format specs (as in ``fmt::join``) for pointers 1458 (`#725 <https://github.com/fmtlib/fmt/pull/725>`_). 1459 Thanks `@mwinterb <https://github.com/mwinterb>`_. 1460 1461* Fixed installation of ``fmt/ranges.h`` 1462 (`#738 <https://github.com/fmtlib/fmt/pull/738>`_). 1463 Thanks `@sv1990 <https://github.com/sv1990>`_. 1464 14654.1.0 - 2017-12-20 1466------------------ 1467 1468* Added ``fmt::to_wstring()`` in addition to ``fmt::to_string()`` 1469 (`#559 <https://github.com/fmtlib/fmt/pull/559>`_). 1470 Thanks `@alabuzhev (Alex Alabuzhev) <https://github.com/alabuzhev>`_. 1471 1472* Added support for C++17 ``std::string_view`` 1473 (`#571 <https://github.com/fmtlib/fmt/pull/571>`_ and 1474 `#578 <https://github.com/fmtlib/fmt/pull/578>`_). 1475 Thanks `@thelostt (Mário Feroldi) <https://github.com/thelostt>`_ and 1476 `@mwinterb <https://github.com/mwinterb>`_. 1477 1478* Enabled stream exceptions to catch errors 1479 (`#581 <https://github.com/fmtlib/fmt/issues/581>`_). 1480 Thanks `@crusader-mike <https://github.com/crusader-mike>`_. 1481 1482* Allowed formatting of class hierarchies with ``fmt::format_arg()`` 1483 (`#547 <https://github.com/fmtlib/fmt/pull/547>`_). 1484 Thanks `@rollbear (Björn Fahller) <https://github.com/rollbear>`_. 1485 1486* Removed limitations on character types 1487 (`#563 <https://github.com/fmtlib/fmt/pull/563>`_). 1488 Thanks `@Yelnats321 (Elnar Dakeshov) <https://github.com/Yelnats321>`_. 1489 1490* Conditionally enabled use of ``std::allocator_traits`` 1491 (`#583 <https://github.com/fmtlib/fmt/pull/583>`_). 1492 Thanks `@mwinterb <https://github.com/mwinterb>`_. 1493 1494* Added support for ``const`` variadic member function emulation with 1495 ``FMT_VARIADIC_CONST`` (`#591 <https://github.com/fmtlib/fmt/pull/591>`_). 1496 Thanks `@ludekvodicka (Ludek Vodicka) <https://github.com/ludekvodicka>`_. 1497 1498* Various bugfixes: bad overflow check, unsupported implicit type conversion 1499 when determining formatting function, test segfaults 1500 (`#551 <https://github.com/fmtlib/fmt/issues/551>`_), ill-formed macros 1501 (`#542 <https://github.com/fmtlib/fmt/pull/542>`_) and ambiguous overloads 1502 (`#580 <https://github.com/fmtlib/fmt/issues/580>`_). 1503 Thanks `@xylosper (Byoung-young Lee) <https://github.com/xylosper>`_. 1504 1505* Prevented warnings on MSVC (`#605 <https://github.com/fmtlib/fmt/pull/605>`_, 1506 `#602 <https://github.com/fmtlib/fmt/pull/602>`_, and 1507 `#545 <https://github.com/fmtlib/fmt/pull/545>`_), 1508 clang (`#582 <https://github.com/fmtlib/fmt/pull/582>`_), 1509 GCC (`#573 <https://github.com/fmtlib/fmt/issues/573>`_), 1510 various conversion warnings (`#609 <https://github.com/fmtlib/fmt/pull/609>`_, 1511 `#567 <https://github.com/fmtlib/fmt/pull/567>`_, 1512 `#553 <https://github.com/fmtlib/fmt/pull/553>`_ and 1513 `#553 <https://github.com/fmtlib/fmt/pull/553>`_), and added ``override`` and 1514 ``[[noreturn]]`` (`#549 <https://github.com/fmtlib/fmt/pull/549>`_ and 1515 `#555 <https://github.com/fmtlib/fmt/issues/555>`_). 1516 Thanks `@alabuzhev (Alex Alabuzhev) <https://github.com/alabuzhev>`_, 1517 `@virgiliofornazin (Virgilio Alexandre Fornazin) 1518 <https://gihtub.com/virgiliofornazin>`_, 1519 `@alexanderbock (Alexander Bock) <https://github.com/alexanderbock>`_, 1520 `@yumetodo <https://github.com/yumetodo>`_, 1521 `@VaderY (Császár Mátyás) <https://github.com/VaderY>`_, 1522 `@jpcima (JP Cimalando) <https://github.com/jpcima>`_, 1523 `@thelostt (Mário Feroldi) <https://github.com/thelostt>`_, and 1524 `@Manu343726 (Manu Sánchez) <https://github.com/Manu343726>`_. 1525 1526* Improved CMake: Used ``GNUInstallDirs`` to set installation location 1527 (`#610 <https://github.com/fmtlib/fmt/pull/610>`_) and fixed warnings 1528 (`#536 <https://github.com/fmtlib/fmt/pull/536>`_ and 1529 `#556 <https://github.com/fmtlib/fmt/pull/556>`_). 1530 Thanks `@mikecrowe (Mike Crowe) <https://github.com/mikecrowe>`_, 1531 `@evgen231 <https://github.com/evgen231>`_ and 1532 `@henryiii (Henry Schreiner) <https://github.com/henryiii>`_. 1533 15344.0.0 - 2017-06-27 1535------------------ 1536 1537* Removed old compatibility headers ``cppformat/*.h`` and CMake options 1538 (`#527 <https://github.com/fmtlib/fmt/pull/527>`_). 1539 Thanks `@maddinat0r (Alex Martin) <https://github.com/maddinat0r>`_. 1540 1541* Added ``string.h`` containing ``fmt::to_string()`` as alternative to 1542 ``std::to_string()`` as well as other string writer functionality 1543 (`#326 <https://github.com/fmtlib/fmt/issues/326>`_ and 1544 `#441 <https://github.com/fmtlib/fmt/pull/441>`_): 1545 1546 .. code:: c++ 1547 1548 #include "fmt/string.h" 1549 1550 std::string answer = fmt::to_string(42); 1551 1552 Thanks to `@glebov-andrey (Andrey Glebov) 1553 <https://github.com/glebov-andrey>`_. 1554 1555* Moved ``fmt::printf()`` to new ``printf.h`` header and allowed ``%s`` as 1556 generic specifier (`#453 <https://github.com/fmtlib/fmt/pull/453>`_), 1557 made ``%.f`` more conformant to regular ``printf()`` 1558 (`#490 <https://github.com/fmtlib/fmt/pull/490>`_), added custom writer 1559 support (`#476 <https://github.com/fmtlib/fmt/issues/476>`_) and implemented 1560 missing custom argument formatting 1561 (`#339 <https://github.com/fmtlib/fmt/pull/339>`_ and 1562 `#340 <https://github.com/fmtlib/fmt/pull/340>`_): 1563 1564 .. code:: c++ 1565 1566 #include "fmt/printf.h" 1567 1568 // %s format specifier can be used with any argument type. 1569 fmt::printf("%s", 42); 1570 1571 Thanks `@mojoBrendan <https://github.com/mojoBrendan>`_, 1572 `@manylegged (Arthur Danskin) <https://github.com/manylegged>`_ and 1573 `@spacemoose (Glen Stark) <https://github.com/spacemoose>`_. 1574 See also `#360 <https://github.com/fmtlib/fmt/issues/360>`_, 1575 `#335 <https://github.com/fmtlib/fmt/issues/335>`_ and 1576 `#331 <https://github.com/fmtlib/fmt/issues/331>`_. 1577 1578* Added ``container.h`` containing a ``BasicContainerWriter`` 1579 to write to containers like ``std::vector`` 1580 (`#450 <https://github.com/fmtlib/fmt/pull/450>`_). 1581 Thanks `@polyvertex (Jean-Charles Lefebvre) <https://github.com/polyvertex>`_. 1582 1583* Added ``fmt::join()`` function that takes a range and formats 1584 its elements separated by a given string 1585 (`#466 <https://github.com/fmtlib/fmt/pull/466>`_): 1586 1587 .. code:: c++ 1588 1589 #include "fmt/format.h" 1590 1591 std::vector<double> v = {1.2, 3.4, 5.6}; 1592 // Prints "(+01.20, +03.40, +05.60)". 1593 fmt::print("({:+06.2f})", fmt::join(v.begin(), v.end(), ", ")); 1594 1595 Thanks `@olivier80 <https://github.com/olivier80>`_. 1596 1597* Added support for custom formatting specifications to simplify customization 1598 of built-in formatting (`#444 <https://github.com/fmtlib/fmt/pull/444>`_). 1599 Thanks `@polyvertex (Jean-Charles Lefebvre) <https://github.com/polyvertex>`_. 1600 See also `#439 <https://github.com/fmtlib/fmt/issues/439>`_. 1601 1602* Added ``fmt::format_system_error()`` for error code formatting 1603 (`#323 <https://github.com/fmtlib/fmt/issues/323>`_ and 1604 `#526 <https://github.com/fmtlib/fmt/pull/526>`_). 1605 Thanks `@maddinat0r (Alex Martin) <https://github.com/maddinat0r>`_. 1606 1607* Added thread-safe ``fmt::localtime()`` and ``fmt::gmtime()`` 1608 as replacement for the standard version to ``time.h`` 1609 (`#396 <https://github.com/fmtlib/fmt/pull/396>`_). 1610 Thanks `@codicodi <https://github.com/codicodi>`_. 1611 1612* Internal improvements to ``NamedArg`` and ``ArgLists`` 1613 (`#389 <https://github.com/fmtlib/fmt/pull/389>`_ and 1614 `#390 <https://github.com/fmtlib/fmt/pull/390>`_). 1615 Thanks `@chronoxor <https://github.com/chronoxor>`_. 1616 1617* Fixed crash due to bug in ``FormatBuf`` 1618 (`#493 <https://github.com/fmtlib/fmt/pull/493>`_). 1619 Thanks `@effzeh <https://github.com/effzeh>`_. See also 1620 `#480 <https://github.com/fmtlib/fmt/issues/480>`_ and 1621 `#491 <https://github.com/fmtlib/fmt/issues/491>`_. 1622 1623* Fixed handling of wide strings in ``fmt::StringWriter``. 1624 1625* Improved compiler error messages 1626 (`#357 <https://github.com/fmtlib/fmt/issues/357>`_). 1627 1628* Fixed various warnings and issues with various compilers 1629 (`#494 <https://github.com/fmtlib/fmt/pull/494>`_, 1630 `#499 <https://github.com/fmtlib/fmt/pull/499>`_, 1631 `#483 <https://github.com/fmtlib/fmt/pull/483>`_, 1632 `#485 <https://github.com/fmtlib/fmt/pull/485>`_, 1633 `#482 <https://github.com/fmtlib/fmt/pull/482>`_, 1634 `#475 <https://github.com/fmtlib/fmt/pull/475>`_, 1635 `#473 <https://github.com/fmtlib/fmt/pull/473>`_ and 1636 `#414 <https://github.com/fmtlib/fmt/pull/414>`_). 1637 Thanks `@chronoxor <https://github.com/chronoxor>`_, 1638 `@zhaohuaxishi <https://github.com/zhaohuaxishi>`_, 1639 `@pkestene (Pierre Kestener) <https://github.com/pkestene>`_, 1640 `@dschmidt (Dominik Schmidt) <https://github.com/dschmidt>`_ and 1641 `@0x414c (Alexey Gorishny) <https://github.com/0x414c>`_ . 1642 1643* Improved CMake: targets are now namespaced 1644 (`#511 <https://github.com/fmtlib/fmt/pull/511>`_ and 1645 `#513 <https://github.com/fmtlib/fmt/pull/513>`_), supported header-only 1646 ``printf.h`` (`#354 <https://github.com/fmtlib/fmt/pull/354>`_), fixed issue 1647 with minimal supported library subset 1648 (`#418 <https://github.com/fmtlib/fmt/issues/418>`_, 1649 `#419 <https://github.com/fmtlib/fmt/pull/419>`_ and 1650 `#420 <https://github.com/fmtlib/fmt/pull/420>`_). 1651 Thanks `@bjoernthiel (Bjoern Thiel) <https://github.com/bjoernthiel>`_, 1652 `@niosHD (Mario Werner) <https://github.com/niosHD>`_, 1653 `@LogicalKnight (Sean LK) <https://github.com/LogicalKnight>`_ and 1654 `@alabuzhev (Alex Alabuzhev) <https://github.com/alabuzhev>`_. 1655 1656* Improved documentation. Thanks to 1657 `@pwm1234 (Phil) <https://github.com/pwm1234>`_ for 1658 `#393 <https://github.com/fmtlib/fmt/pull/393>`_. 1659 16603.0.2 - 2017-06-14 1661------------------ 1662 1663* Added ``FMT_VERSION`` macro 1664 (`#411 <https://github.com/fmtlib/fmt/issues/411>`_). 1665 1666* Used ``FMT_NULL`` instead of literal ``0`` 1667 (`#409 <https://github.com/fmtlib/fmt/pull/409>`_). 1668 Thanks `@alabuzhev (Alex Alabuzhev) <https://github.com/alabuzhev>`_. 1669 1670* Added extern templates for ``format_float`` 1671 (`#413 <https://github.com/fmtlib/fmt/issues/413>`_). 1672 1673* Fixed implicit conversion issue 1674 (`#507 <https://github.com/fmtlib/fmt/issues/507>`_). 1675 1676* Fixed signbit detection (`#423 <https://github.com/fmtlib/fmt/issues/423>`_). 1677 1678* Fixed naming collision (`#425 <https://github.com/fmtlib/fmt/issues/425>`_). 1679 1680* Fixed missing intrinsic for C++/CLI 1681 (`#457 <https://github.com/fmtlib/fmt/pull/457>`_). 1682 Thanks `@calumr (Calum Robinson) <https://github.com/calumr>`_ 1683 1684* Fixed Android detection (`#458 <https://github.com/fmtlib/fmt/pull/458>`_). 1685 Thanks `@Gachapen (Magnus Bjerke Vik) <https://github.com/Gachapen>`_. 1686 1687* Use lean ``windows.h`` if not in header-only mode 1688 (`#503 <https://github.com/fmtlib/fmt/pull/503>`_). 1689 Thanks `@Quentin01 (Quentin Buathier) <https://github.com/Quentin01>`_. 1690 1691* Fixed issue with CMake exporting C++11 flag 1692 (`#445 <https://github.com/fmtlib/fmt/pull/455>`_). 1693 Thanks `@EricWF (Eric) <https://github.com/EricWF>`_. 1694 1695* Fixed issue with nvcc and MSVC compiler bug and MinGW 1696 (`#505 <https://github.com/fmtlib/fmt/issues/505>`_). 1697 1698* Fixed DLL issues (`#469 <https://github.com/fmtlib/fmt/pull/469>`_ and 1699 `#502 <https://github.com/fmtlib/fmt/pull/502>`_). 1700 Thanks `@richardeakin (Richard Eakin) <https://github.com/richardeakin>`_ and 1701 `@AndreasSchoenle (Andreas Schönle) <https://github.com/AndreasSchoenle>`_. 1702 1703* Fixed test compilation under FreeBSD 1704 (`#433 <https://github.com/fmtlib/fmt/issues/433>`_). 1705 1706* Fixed various warnings (`#403 <https://github.com/fmtlib/fmt/pull/403>`_, 1707 `#410 <https://github.com/fmtlib/fmt/pull/410>`_ and 1708 `#510 <https://github.com/fmtlib/fmt/pull/510>`_). 1709 Thanks `@Lecetem <https://github.com/Lectem>`_, 1710 `@chenhayat (Chen Hayat) <https://github.com/chenhayat>`_ and 1711 `@trozen <https://github.com/trozen>`_. 1712 1713* Worked around a broken ``__builtin_clz`` in clang with MS codegen 1714 (`#519 <https://github.com/fmtlib/fmt/issues/519>`_). 1715 1716* Removed redundant include 1717 (`#479 <https://github.com/fmtlib/fmt/issues/479>`_). 1718 1719* Fixed documentation issues. 1720 17213.0.1 - 2016-11-01 1722------------------ 1723* Fixed handling of thousands separator 1724 (`#353 <https://github.com/fmtlib/fmt/issues/353>`_). 1725 1726* Fixed handling of ``unsigned char`` strings 1727 (`#373 <https://github.com/fmtlib/fmt/issues/373>`_). 1728 1729* Corrected buffer growth when formatting time 1730 (`#367 <https://github.com/fmtlib/fmt/issues/367>`_). 1731 1732* Removed warnings under MSVC and clang 1733 (`#318 <https://github.com/fmtlib/fmt/issues/318>`_, 1734 `#250 <https://github.com/fmtlib/fmt/issues/250>`_, also merged 1735 `#385 <https://github.com/fmtlib/fmt/pull/385>`_ and 1736 `#361 <https://github.com/fmtlib/fmt/pull/361>`_). 1737 Thanks `@jcelerier (Jean-Michaël Celerier) <https://github.com/jcelerier>`_ 1738 and `@nmoehrle (Nils Moehrle) <https://github.com/nmoehrle>`_. 1739 1740* Fixed compilation issues under Android 1741 (`#327 <https://github.com/fmtlib/fmt/pull/327>`_, 1742 `#345 <https://github.com/fmtlib/fmt/issues/345>`_ and 1743 `#381 <https://github.com/fmtlib/fmt/pull/381>`_), 1744 FreeBSD (`#358 <https://github.com/fmtlib/fmt/pull/358>`_), 1745 Cygwin (`#388 <https://github.com/fmtlib/fmt/issues/388>`_), 1746 MinGW (`#355 <https://github.com/fmtlib/fmt/issues/355>`_) as well as other 1747 issues (`#350 <https://github.com/fmtlib/fmt/issues/350>`_, 1748 `#366 <https://github.com/fmtlib/fmt/issues/355>`_, 1749 `#348 <https://github.com/fmtlib/fmt/pull/348>`_, 1750 `#402 <https://github.com/fmtlib/fmt/pull/402>`_, 1751 `#405 <https://github.com/fmtlib/fmt/pull/405>`_). 1752 Thanks to `@dpantele (Dmitry) <https://github.com/dpantele>`_, 1753 `@hghwng (Hugh Wang) <https://github.com/hghwng>`_, 1754 `@arvedarved (Tilman Keskinöz) <https://github.com/arvedarved>`_, 1755 `@LogicalKnight (Sean) <https://github.com/LogicalKnight>`_ and 1756 `@JanHellwig (Jan Hellwig) <https://github.com/janhellwig>`_. 1757 1758* Fixed some documentation issues and extended specification 1759 (`#320 <https://github.com/fmtlib/fmt/issues/320>`_, 1760 `#333 <https://github.com/fmtlib/fmt/pull/333>`_, 1761 `#347 <https://github.com/fmtlib/fmt/issues/347>`_, 1762 `#362 <https://github.com/fmtlib/fmt/pull/362>`_). 1763 Thanks to `@smellman (Taro Matsuzawa aka. btm) 1764 <https://github.com/smellman>`_. 1765 17663.0.0 - 2016-05-07 1767------------------ 1768 1769* The project has been renamed from C++ Format (cppformat) to fmt for 1770 consistency with the used namespace and macro prefix 1771 (`#307 <https://github.com/fmtlib/fmt/issues/307>`_). 1772 Library headers are now located in the ``fmt`` directory: 1773 1774 .. code:: c++ 1775 1776 #include "fmt/format.h" 1777 1778 Including ``format.h`` from the ``cppformat`` directory is deprecated 1779 but works via a proxy header which will be removed in the next major version. 1780 1781 The documentation is now available at https://fmt.dev. 1782 1783* Added support for `strftime <http://en.cppreference.com/w/cpp/chrono/c/strftime>`_-like 1784 `date and time formatting <https://fmt.dev/3.0.0/api.html#date-and-time-formatting>`_ 1785 (`#283 <https://github.com/fmtlib/fmt/issues/283>`_): 1786 1787 .. code:: c++ 1788 1789 #include "fmt/time.h" 1790 1791 std::time_t t = std::time(nullptr); 1792 // Prints "The date is 2016-04-29." (with the current date) 1793 fmt::print("The date is {:%Y-%m-%d}.", *std::localtime(&t)); 1794 1795* ``std::ostream`` support including formatting of user-defined types that provide 1796 overloaded ``operator<<`` has been moved to ``fmt/ostream.h``: 1797 1798 .. code:: c++ 1799 1800 #include "fmt/ostream.h" 1801 1802 class Date { 1803 int year_, month_, day_; 1804 public: 1805 Date(int year, int month, int day) : year_(year), month_(month), day_(day) {} 1806 1807 friend std::ostream &operator<<(std::ostream &os, const Date &d) { 1808 return os << d.year_ << '-' << d.month_ << '-' << d.day_; 1809 } 1810 }; 1811 1812 std::string s = fmt::format("The date is {}", Date(2012, 12, 9)); 1813 // s == "The date is 2012-12-9" 1814 1815* Added support for `custom argument formatters 1816 <https://fmt.dev/3.0.0/api.html#argument-formatters>`_ 1817 (`#235 <https://github.com/fmtlib/fmt/issues/235>`_). 1818 1819* Added support for locale-specific integer formatting with the ``n`` specifier 1820 (`#305 <https://github.com/fmtlib/fmt/issues/305>`_): 1821 1822 .. code:: c++ 1823 1824 std::setlocale(LC_ALL, "en_US.utf8"); 1825 fmt::print("cppformat: {:n}\n", 1234567); // prints 1,234,567 1826 1827* Sign is now preserved when formatting an integer with an incorrect ``printf`` 1828 format specifier (`#265 <https://github.com/fmtlib/fmt/issues/265>`_): 1829 1830 .. code:: c++ 1831 1832 fmt::printf("%lld", -42); // prints -42 1833 1834 Note that it would be an undefined behavior in ``std::printf``. 1835 1836* Length modifiers such as ``ll`` are now optional in printf formatting 1837 functions and the correct type is determined automatically 1838 (`#255 <https://github.com/fmtlib/fmt/issues/255>`_): 1839 1840 .. code:: c++ 1841 1842 fmt::printf("%d", std::numeric_limits<long long>::max()); 1843 1844 Note that it would be an undefined behavior in ``std::printf``. 1845 1846* Added initial support for custom formatters 1847 (`#231 <https://github.com/fmtlib/fmt/issues/231>`_). 1848 1849* Fixed detection of user-defined literal support on Intel C++ compiler 1850 (`#311 <https://github.com/fmtlib/fmt/issues/311>`_, 1851 `#312 <https://github.com/fmtlib/fmt/pull/312>`_). 1852 Thanks to `@dean0x7d (Dean Moldovan) <https://github.com/dean0x7d>`_ and 1853 `@speth (Ray Speth) <https://github.com/speth>`_. 1854 1855* Reduced compile time 1856 (`#243 <https://github.com/fmtlib/fmt/pull/243>`_, 1857 `#249 <https://github.com/fmtlib/fmt/pull/249>`_, 1858 `#317 <https://github.com/fmtlib/fmt/issues/317>`_): 1859 1860 .. image:: https://cloud.githubusercontent.com/assets/4831417/11614060/ 1861 b9e826d2-9c36-11e5-8666-d4131bf503ef.png 1862 1863 .. image:: https://cloud.githubusercontent.com/assets/4831417/11614080/ 1864 6ac903cc-9c37-11e5-8165-26df6efae364.png 1865 1866 Thanks to `@dean0x7d (Dean Moldovan) <https://github.com/dean0x7d>`_. 1867 1868* Compile test fixes (`#313 <https://github.com/fmtlib/fmt/pull/313>`_). 1869 Thanks to `@dean0x7d (Dean Moldovan) <https://github.com/dean0x7d>`_. 1870 1871* Documentation fixes (`#239 <https://github.com/fmtlib/fmt/pull/239>`_, 1872 `#248 <https://github.com/fmtlib/fmt/issues/248>`_, 1873 `#252 <https://github.com/fmtlib/fmt/issues/252>`_, 1874 `#258 <https://github.com/fmtlib/fmt/pull/258>`_, 1875 `#260 <https://github.com/fmtlib/fmt/issues/260>`_, 1876 `#301 <https://github.com/fmtlib/fmt/issues/301>`_, 1877 `#309 <https://github.com/fmtlib/fmt/pull/309>`_). 1878 Thanks to `@ReadmeCritic <https://github.com/ReadmeCritic>`_ 1879 `@Gachapen (Magnus Bjerke Vik) <https://github.com/Gachapen>`_ and 1880 `@jwilk (Jakub Wilk) <https://github.com/jwilk>`_. 1881 1882* Fixed compiler and sanitizer warnings 1883 (`#244 <https://github.com/fmtlib/fmt/issues/244>`_, 1884 `#256 <https://github.com/fmtlib/fmt/pull/256>`_, 1885 `#259 <https://github.com/fmtlib/fmt/pull/259>`_, 1886 `#263 <https://github.com/fmtlib/fmt/issues/263>`_, 1887 `#274 <https://github.com/fmtlib/fmt/issues/274>`_, 1888 `#277 <https://github.com/fmtlib/fmt/pull/277>`_, 1889 `#286 <https://github.com/fmtlib/fmt/pull/286>`_, 1890 `#291 <https://github.com/fmtlib/fmt/issues/291>`_, 1891 `#296 <https://github.com/fmtlib/fmt/issues/296>`_, 1892 `#308 <https://github.com/fmtlib/fmt/issues/308>`_) 1893 Thanks to `@mwinterb <https://github.com/mwinterb>`_, 1894 `@pweiskircher (Patrik Weiskircher) <https://github.com/pweiskircher>`_, 1895 `@Naios <https://github.com/Naios>`_. 1896 1897* Improved compatibility with Windows Store apps 1898 (`#280 <https://github.com/fmtlib/fmt/issues/280>`_, 1899 `#285 <https://github.com/fmtlib/fmt/pull/285>`_) 1900 Thanks to `@mwinterb <https://github.com/mwinterb>`_. 1901 1902* Added tests of compatibility with older C++ standards 1903 (`#273 <https://github.com/fmtlib/fmt/pull/273>`_). 1904 Thanks to `@niosHD <https://github.com/niosHD>`_. 1905 1906* Fixed Android build (`#271 <https://github.com/fmtlib/fmt/pull/271>`_). 1907 Thanks to `@newnon <https://github.com/newnon>`_. 1908 1909* Changed ``ArgMap`` to be backed by a vector instead of a map. 1910 (`#261 <https://github.com/fmtlib/fmt/issues/261>`_, 1911 `#262 <https://github.com/fmtlib/fmt/pull/262>`_). 1912 Thanks to `@mwinterb <https://github.com/mwinterb>`_. 1913 1914* Added ``fprintf`` overload that writes to a ``std::ostream`` 1915 (`#251 <https://github.com/fmtlib/fmt/pull/251>`_). 1916 Thanks to `nickhutchinson (Nicholas Hutchinson) <https://github.com/nickhutchinson>`_. 1917 1918* Export symbols when building a Windows DLL 1919 (`#245 <https://github.com/fmtlib/fmt/pull/245>`_). 1920 Thanks to `macdems (Maciek Dems) <https://github.com/macdems>`_. 1921 1922* Fixed compilation on Cygwin (`#304 <https://github.com/fmtlib/fmt/issues/304>`_). 1923 1924* Implemented a workaround for a bug in Apple LLVM version 4.2 of clang 1925 (`#276 <https://github.com/fmtlib/fmt/issues/276>`_). 1926 1927* Implemented a workaround for Google Test bug 1928 `#705 <https://github.com/google/googletest/issues/705>`_ on gcc 6 1929 (`#268 <https://github.com/fmtlib/fmt/issues/268>`_). 1930 Thanks to `octoploid <https://github.com/octoploid>`_. 1931 1932* Removed Biicode support because the latter has been discontinued. 1933 19342.1.1 - 2016-04-11 1935------------------ 1936 1937* The install location for generated CMake files is now configurable via 1938 the ``FMT_CMAKE_DIR`` CMake variable 1939 (`#299 <https://github.com/fmtlib/fmt/pull/299>`_). 1940 Thanks to `@niosHD <https://github.com/niosHD>`_. 1941 1942* Documentation fixes (`#252 <https://github.com/fmtlib/fmt/issues/252>`_). 1943 19442.1.0 - 2016-03-21 1945------------------ 1946 1947* Project layout and build system improvements 1948 (`#267 <https://github.com/fmtlib/fmt/pull/267>`_): 1949 1950 * The code have been moved to the ``cppformat`` directory. 1951 Including ``format.h`` from the top-level directory is deprecated 1952 but works via a proxy header which will be removed in the next 1953 major version. 1954 1955 * C++ Format CMake targets now have proper interface definitions. 1956 1957 * Installed version of the library now supports the header-only 1958 configuration. 1959 1960 * Targets ``doc``, ``install``, and ``test`` are now disabled if C++ Format 1961 is included as a CMake subproject. They can be enabled by setting 1962 ``FMT_DOC``, ``FMT_INSTALL``, and ``FMT_TEST`` in the parent project. 1963 1964 Thanks to `@niosHD <https://github.com/niosHD>`_. 1965 19662.0.1 - 2016-03-13 1967------------------ 1968 1969* Improved CMake find and package support 1970 (`#264 <https://github.com/fmtlib/fmt/issues/264>`_). 1971 Thanks to `@niosHD <https://github.com/niosHD>`_. 1972 1973* Fix compile error with Android NDK and mingw32 1974 (`#241 <https://github.com/fmtlib/fmt/issues/241>`_). 1975 Thanks to `@Gachapen (Magnus Bjerke Vik) <https://github.com/Gachapen>`_. 1976 1977* Documentation fixes 1978 (`#248 <https://github.com/fmtlib/fmt/issues/248>`_, 1979 `#260 <https://github.com/fmtlib/fmt/issues/260>`_). 1980 19812.0.0 - 2015-12-01 1982------------------ 1983 1984General 1985~~~~~~~ 1986 1987* [Breaking] Named arguments 1988 (`#169 <https://github.com/fmtlib/fmt/pull/169>`_, 1989 `#173 <https://github.com/fmtlib/fmt/pull/173>`_, 1990 `#174 <https://github.com/fmtlib/fmt/pull/174>`_): 1991 1992 .. code:: c++ 1993 1994 fmt::print("The answer is {answer}.", fmt::arg("answer", 42)); 1995 1996 Thanks to `@jamboree <https://github.com/jamboree>`_. 1997 1998* [Experimental] User-defined literals for format and named arguments 1999 (`#204 <https://github.com/fmtlib/fmt/pull/204>`_, 2000 `#206 <https://github.com/fmtlib/fmt/pull/206>`_, 2001 `#207 <https://github.com/fmtlib/fmt/pull/207>`_): 2002 2003 .. code:: c++ 2004 2005 using namespace fmt::literals; 2006 fmt::print("The answer is {answer}.", "answer"_a=42); 2007 2008 Thanks to `@dean0x7d (Dean Moldovan) <https://github.com/dean0x7d>`_. 2009 2010* [Breaking] Formatting of more than 16 arguments is now supported when using 2011 variadic templates 2012 (`#141 <https://github.com/fmtlib/fmt/issues/141>`_). 2013 Thanks to `@Shauren <https://github.com/Shauren>`_. 2014 2015* Runtime width specification 2016 (`#168 <https://github.com/fmtlib/fmt/pull/168>`_): 2017 2018 .. code:: c++ 2019 2020 fmt::format("{0:{1}}", 42, 5); // gives " 42" 2021 2022 Thanks to `@jamboree <https://github.com/jamboree>`_. 2023 2024* [Breaking] Enums are now formatted with an overloaded ``std::ostream`` insertion 2025 operator (``operator<<``) if available 2026 (`#232 <https://github.com/fmtlib/fmt/issues/232>`_). 2027 2028* [Breaking] Changed default ``bool`` format to textual, "true" or "false" 2029 (`#170 <https://github.com/fmtlib/fmt/issues/170>`_): 2030 2031 .. code:: c++ 2032 2033 fmt::print("{}", true); // prints "true" 2034 2035 To print ``bool`` as a number use numeric format specifier such as ``d``: 2036 2037 .. code:: c++ 2038 2039 fmt::print("{:d}", true); // prints "1" 2040 2041* ``fmt::printf`` and ``fmt::sprintf`` now support formatting of ``bool`` with the 2042 ``%s`` specifier giving textual output, "true" or "false" 2043 (`#223 <https://github.com/fmtlib/fmt/pull/223>`_): 2044 2045 .. code:: c++ 2046 2047 fmt::printf("%s", true); // prints "true" 2048 2049 Thanks to `@LarsGullik <https://github.com/LarsGullik>`_. 2050 2051* [Breaking] ``signed char`` and ``unsigned char`` are now formatted as integers by default 2052 (`#217 <https://github.com/fmtlib/fmt/pull/217>`_). 2053 2054* [Breaking] Pointers to C strings can now be formatted with the ``p`` specifier 2055 (`#223 <https://github.com/fmtlib/fmt/pull/223>`_): 2056 2057 .. code:: c++ 2058 2059 fmt::print("{:p}", "test"); // prints pointer value 2060 2061 Thanks to `@LarsGullik <https://github.com/LarsGullik>`_. 2062 2063* [Breaking] ``fmt::printf`` and ``fmt::sprintf`` now print null pointers as ``(nil)`` 2064 and null strings as ``(null)`` for consistency with glibc 2065 (`#226 <https://github.com/fmtlib/fmt/pull/226>`_). 2066 Thanks to `@LarsGullik <https://github.com/LarsGullik>`_. 2067 2068* [Breaking] ``fmt::(s)printf`` now supports formatting of objects of user-defined types 2069 that provide an overloaded ``std::ostream`` insertion operator (``operator<<``) 2070 (`#201 <https://github.com/fmtlib/fmt/issues/201>`_): 2071 2072 .. code:: c++ 2073 2074 fmt::printf("The date is %s", Date(2012, 12, 9)); 2075 2076* [Breaking] The ``Buffer`` template is now part of the public API and can be used 2077 to implement custom memory buffers 2078 (`#140 <https://github.com/fmtlib/fmt/issues/140>`_). 2079 Thanks to `@polyvertex (Jean-Charles Lefebvre) <https://github.com/polyvertex>`_. 2080 2081* [Breaking] Improved compatibility between ``BasicStringRef`` and 2082 `std::experimental::basic_string_view 2083 <http://en.cppreference.com/w/cpp/experimental/basic_string_view>`_ 2084 (`#100 <https://github.com/fmtlib/fmt/issues/100>`_, 2085 `#159 <https://github.com/fmtlib/fmt/issues/159>`_, 2086 `#183 <https://github.com/fmtlib/fmt/issues/183>`_): 2087 2088 - Comparison operators now compare string content, not pointers 2089 - ``BasicStringRef::c_str`` replaced by ``BasicStringRef::data`` 2090 - ``BasicStringRef`` is no longer assumed to be null-terminated 2091 2092 References to null-terminated strings are now represented by a new class, 2093 ``BasicCStringRef``. 2094 2095* Dependency on pthreads introduced by Google Test is now optional 2096 (`#185 <https://github.com/fmtlib/fmt/issues/185>`_). 2097 2098* New CMake options ``FMT_DOC``, ``FMT_INSTALL`` and ``FMT_TEST`` to control 2099 generation of ``doc``, ``install`` and ``test`` targets respectively, on by default 2100 (`#197 <https://github.com/fmtlib/fmt/issues/197>`_, 2101 `#198 <https://github.com/fmtlib/fmt/issues/198>`_, 2102 `#200 <https://github.com/fmtlib/fmt/issues/200>`_). 2103 Thanks to `@maddinat0r (Alex Martin) <https://github.com/maddinat0r>`_. 2104 2105* ``noexcept`` is now used when compiling with MSVC2015 2106 (`#215 <https://github.com/fmtlib/fmt/pull/215>`_). 2107 Thanks to `@dmkrepo (Dmitriy) <https://github.com/dmkrepo>`_. 2108 2109* Added an option to disable use of ``windows.h`` when ``FMT_USE_WINDOWS_H`` 2110 is defined as 0 before including ``format.h`` 2111 (`#171 <https://github.com/fmtlib/fmt/issues/171>`_). 2112 Thanks to `@alfps (Alf P. Steinbach) <https://github.com/alfps>`_. 2113 2114* [Breaking] ``windows.h`` is now included with ``NOMINMAX`` unless 2115 ``FMT_WIN_MINMAX`` is defined. This is done to prevent breaking code using 2116 ``std::min`` and ``std::max`` and only affects the header-only configuration 2117 (`#152 <https://github.com/fmtlib/fmt/issues/152>`_, 2118 `#153 <https://github.com/fmtlib/fmt/pull/153>`_, 2119 `#154 <https://github.com/fmtlib/fmt/pull/154>`_). 2120 Thanks to `@DevO2012 <https://github.com/DevO2012>`_. 2121 2122* Improved support for custom character types 2123 (`#171 <https://github.com/fmtlib/fmt/issues/171>`_). 2124 Thanks to `@alfps (Alf P. Steinbach) <https://github.com/alfps>`_. 2125 2126* Added an option to disable use of IOStreams when ``FMT_USE_IOSTREAMS`` 2127 is defined as 0 before including ``format.h`` 2128 (`#205 <https://github.com/fmtlib/fmt/issues/205>`_, 2129 `#208 <https://github.com/fmtlib/fmt/pull/208>`_). 2130 Thanks to `@JodiTheTigger <https://github.com/JodiTheTigger>`_. 2131 2132* Improved detection of ``isnan``, ``isinf`` and ``signbit``. 2133 2134Optimization 2135~~~~~~~~~~~~ 2136 2137* Made formatting of user-defined types more efficient with a custom stream buffer 2138 (`#92 <https://github.com/fmtlib/fmt/issues/92>`_, 2139 `#230 <https://github.com/fmtlib/fmt/pull/230>`_). 2140 Thanks to `@NotImplemented <https://github.com/NotImplemented>`_. 2141 2142* Further improved performance of ``fmt::Writer`` on integer formatting 2143 and fixed a minor regression. Now it is ~7% faster than ``karma::generate`` 2144 on Karma's benchmark 2145 (`#186 <https://github.com/fmtlib/fmt/issues/186>`_). 2146 2147* [Breaking] Reduced `compiled code size 2148 <https://github.com/fmtlib/fmt#compile-time-and-code-bloat>`_ 2149 (`#143 <https://github.com/fmtlib/fmt/issues/143>`_, 2150 `#149 <https://github.com/fmtlib/fmt/pull/149>`_). 2151 2152Distribution 2153~~~~~~~~~~~~ 2154 2155* [Breaking] Headers are now installed in 2156 ``${CMAKE_INSTALL_PREFIX}/include/cppformat`` 2157 (`#178 <https://github.com/fmtlib/fmt/issues/178>`_). 2158 Thanks to `@jackyf (Eugene V. Lyubimkin) <https://github.com/jackyf>`_. 2159 2160* [Breaking] Changed the library name from ``format`` to ``cppformat`` 2161 for consistency with the project name and to avoid potential conflicts 2162 (`#178 <https://github.com/fmtlib/fmt/issues/178>`_). 2163 Thanks to `@jackyf (Eugene V. Lyubimkin) <https://github.com/jackyf>`_. 2164 2165* C++ Format is now available in `Debian <https://www.debian.org/>`_ GNU/Linux 2166 (`stretch <https://packages.debian.org/source/stretch/cppformat>`_, 2167 `sid <https://packages.debian.org/source/sid/cppformat>`_) and 2168 derived distributions such as 2169 `Ubuntu <https://launchpad.net/ubuntu/+source/cppformat>`_ 15.10 and later 2170 (`#155 <https://github.com/fmtlib/fmt/issues/155>`_):: 2171 2172 $ sudo apt-get install libcppformat1-dev 2173 2174 Thanks to `@jackyf (Eugene V. Lyubimkin) <https://github.com/jackyf>`_. 2175 2176* `Packages for Fedora and RHEL <https://admin.fedoraproject.org/pkgdb/package/cppformat/>`_ 2177 are now available. Thanks to Dave Johansen. 2178 2179* C++ Format can now be installed via `Homebrew <http://brew.sh/>`_ on OS X 2180 (`#157 <https://github.com/fmtlib/fmt/issues/157>`_):: 2181 2182 $ brew install cppformat 2183 2184 Thanks to `@ortho <https://github.com/ortho>`_, Anatoliy Bulukin. 2185 2186Documentation 2187~~~~~~~~~~~~~ 2188 2189* Migrated from ReadTheDocs to GitHub Pages for better responsiveness 2190 and reliability 2191 (`#128 <https://github.com/fmtlib/fmt/issues/128>`_). 2192 New documentation address is http://cppformat.github.io/. 2193 2194 2195* Added `Building the documentation 2196 <https://fmt.dev/2.0.0/usage.html#building-the-documentation>`_ 2197 section to the documentation. 2198 2199* Documentation build script is now compatible with Python 3 and newer pip versions. 2200 (`#189 <https://github.com/fmtlib/fmt/pull/189>`_, 2201 `#209 <https://github.com/fmtlib/fmt/issues/209>`_). 2202 Thanks to `@JodiTheTigger <https://github.com/JodiTheTigger>`_ and 2203 `@xentec <https://github.com/xentec>`_. 2204 2205* Documentation fixes and improvements 2206 (`#36 <https://github.com/fmtlib/fmt/issues/36>`_, 2207 `#75 <https://github.com/fmtlib/fmt/issues/75>`_, 2208 `#125 <https://github.com/fmtlib/fmt/issues/125>`_, 2209 `#160 <https://github.com/fmtlib/fmt/pull/160>`_, 2210 `#161 <https://github.com/fmtlib/fmt/pull/161>`_, 2211 `#162 <https://github.com/fmtlib/fmt/issues/162>`_, 2212 `#165 <https://github.com/fmtlib/fmt/issues/165>`_, 2213 `#210 <https://github.com/fmtlib/fmt/issues/210>`_). 2214 Thanks to `@syohex (Syohei YOSHIDA) <https://github.com/syohex>`_ and 2215 bug reporters. 2216 2217* Fixed out-of-tree documentation build 2218 (`#177 <https://github.com/fmtlib/fmt/issues/177>`_). 2219 Thanks to `@jackyf (Eugene V. Lyubimkin) <https://github.com/jackyf>`_. 2220 2221Fixes 2222~~~~~ 2223 2224* Fixed ``initializer_list`` detection 2225 (`#136 <https://github.com/fmtlib/fmt/issues/136>`_). 2226 Thanks to `@Gachapen (Magnus Bjerke Vik) <https://github.com/Gachapen>`_. 2227 2228* [Breaking] Fixed formatting of enums with numeric format specifiers in 2229 ``fmt::(s)printf`` 2230 (`#131 <https://github.com/fmtlib/fmt/issues/131>`_, 2231 `#139 <https://github.com/fmtlib/fmt/issues/139>`_): 2232 2233 .. code:: c++ 2234 2235 enum { ANSWER = 42 }; 2236 fmt::printf("%d", ANSWER); 2237 2238 Thanks to `@Naios <https://github.com/Naios>`_. 2239 2240* Improved compatibility with old versions of MinGW 2241 (`#129 <https://github.com/fmtlib/fmt/issues/129>`_, 2242 `#130 <https://github.com/fmtlib/fmt/pull/130>`_, 2243 `#132 <https://github.com/fmtlib/fmt/issues/132>`_). 2244 Thanks to `@cstamford (Christopher Stamford) <https://github.com/cstamford>`_. 2245 2246* Fixed a compile error on MSVC with disabled exceptions 2247 (`#144 <https://github.com/fmtlib/fmt/issues/144>`_). 2248 2249* Added a workaround for broken implementation of variadic templates in MSVC2012 2250 (`#148 <https://github.com/fmtlib/fmt/issues/148>`_). 2251 2252* Placed the anonymous namespace within ``fmt`` namespace for the header-only 2253 configuration 2254 (`#171 <https://github.com/fmtlib/fmt/issues/171>`_). 2255 Thanks to `@alfps (Alf P. Steinbach) <https://github.com/alfps>`_. 2256 2257* Fixed issues reported by Coverity Scan 2258 (`#187 <https://github.com/fmtlib/fmt/issues/187>`_, 2259 `#192 <https://github.com/fmtlib/fmt/issues/192>`_). 2260 2261* Implemented a workaround for a name lookup bug in MSVC2010 2262 (`#188 <https://github.com/fmtlib/fmt/issues/188>`_). 2263 2264* Fixed compiler warnings 2265 (`#95 <https://github.com/fmtlib/fmt/issues/95>`_, 2266 `#96 <https://github.com/fmtlib/fmt/issues/96>`_, 2267 `#114 <https://github.com/fmtlib/fmt/pull/114>`_, 2268 `#135 <https://github.com/fmtlib/fmt/issues/135>`_, 2269 `#142 <https://github.com/fmtlib/fmt/issues/142>`_, 2270 `#145 <https://github.com/fmtlib/fmt/issues/145>`_, 2271 `#146 <https://github.com/fmtlib/fmt/issues/146>`_, 2272 `#158 <https://github.com/fmtlib/fmt/issues/158>`_, 2273 `#163 <https://github.com/fmtlib/fmt/issues/163>`_, 2274 `#175 <https://github.com/fmtlib/fmt/issues/175>`_, 2275 `#190 <https://github.com/fmtlib/fmt/issues/190>`_, 2276 `#191 <https://github.com/fmtlib/fmt/pull/191>`_, 2277 `#194 <https://github.com/fmtlib/fmt/issues/194>`_, 2278 `#196 <https://github.com/fmtlib/fmt/pull/196>`_, 2279 `#216 <https://github.com/fmtlib/fmt/issues/216>`_, 2280 `#218 <https://github.com/fmtlib/fmt/pull/218>`_, 2281 `#220 <https://github.com/fmtlib/fmt/pull/220>`_, 2282 `#229 <https://github.com/fmtlib/fmt/pull/229>`_, 2283 `#233 <https://github.com/fmtlib/fmt/issues/233>`_, 2284 `#234 <https://github.com/fmtlib/fmt/issues/234>`_, 2285 `#236 <https://github.com/fmtlib/fmt/pull/236>`_, 2286 `#281 <https://github.com/fmtlib/fmt/issues/281>`_, 2287 `#289 <https://github.com/fmtlib/fmt/issues/289>`_). 2288 Thanks to `@seanmiddleditch (Sean Middleditch) <https://github.com/seanmiddleditch>`_, 2289 `@dixlorenz (Dix Lorenz) <https://github.com/dixlorenz>`_, 2290 `@CarterLi (李通洲) <https://github.com/CarterLi>`_, 2291 `@Naios <https://github.com/Naios>`_, 2292 `@fmatthew5876 (Matthew Fioravante) <https://github.com/fmatthew5876>`_, 2293 `@LevskiWeng (Levski Weng) <https://github.com/LevskiWeng>`_, 2294 `@rpopescu <https://github.com/rpopescu>`_, 2295 `@gabime (Gabi Melman) <https://github.com/gabime>`_, 2296 `@cubicool (Jeremy Moles) <https://github.com/cubicool>`_, 2297 `@jkflying (Julian Kent) <https://github.com/jkflying>`_, 2298 `@LogicalKnight (Sean L) <https://github.com/LogicalKnight>`_, 2299 `@inguin (Ingo van Lil) <https://github.com/inguin>`_ and 2300 `@Jopie64 (Johan) <https://github.com/Jopie64>`_. 2301 2302* Fixed portability issues (mostly causing test failures) on ARM, ppc64, ppc64le, 2303 s390x and SunOS 5.11 i386 2304 (`#138 <https://github.com/fmtlib/fmt/issues/138>`_, 2305 `#179 <https://github.com/fmtlib/fmt/issues/179>`_, 2306 `#180 <https://github.com/fmtlib/fmt/issues/180>`_, 2307 `#202 <https://github.com/fmtlib/fmt/issues/202>`_, 2308 `#225 <https://github.com/fmtlib/fmt/issues/225>`_, 2309 `Red Hat Bugzilla Bug 1260297 <https://bugzilla.redhat.com/show_bug.cgi?id=1260297>`_). 2310 Thanks to `@Naios <https://github.com/Naios>`_, 2311 `@jackyf (Eugene V. Lyubimkin) <https://github.com/jackyf>`_ and Dave Johansen. 2312 2313* Fixed a name conflict with macro ``free`` defined in 2314 ``crtdbg.h`` when ``_CRTDBG_MAP_ALLOC`` is set 2315 (`#211 <https://github.com/fmtlib/fmt/issues/211>`_). 2316 2317* Fixed shared library build on OS X 2318 (`#212 <https://github.com/fmtlib/fmt/pull/212>`_). 2319 Thanks to `@dean0x7d (Dean Moldovan) <https://github.com/dean0x7d>`_. 2320 2321* Fixed an overload conflict on MSVC when ``/Zc:wchar_t-`` option is specified 2322 (`#214 <https://github.com/fmtlib/fmt/pull/214>`_). 2323 Thanks to `@slavanap (Vyacheslav Napadovsky) <https://github.com/slavanap>`_. 2324 2325* Improved compatibility with MSVC 2008 2326 (`#236 <https://github.com/fmtlib/fmt/pull/236>`_). 2327 Thanks to `@Jopie64 (Johan) <https://github.com/Jopie64>`_. 2328 2329* Improved compatibility with bcc32 2330 (`#227 <https://github.com/fmtlib/fmt/issues/227>`_). 2331 2332* Fixed ``static_assert`` detection on Clang 2333 (`#228 <https://github.com/fmtlib/fmt/pull/228>`_). 2334 Thanks to `@dean0x7d (Dean Moldovan) <https://github.com/dean0x7d>`_. 2335 23361.1.0 - 2015-03-06 2337------------------ 2338 2339* Added ``BasicArrayWriter``, a class template that provides operations for 2340 formatting and writing data into a fixed-size array 2341 (`#105 <https://github.com/fmtlib/fmt/issues/105>`_ and 2342 `#122 <https://github.com/fmtlib/fmt/issues/122>`_): 2343 2344 .. code:: c++ 2345 2346 char buffer[100]; 2347 fmt::ArrayWriter w(buffer); 2348 w.write("The answer is {}", 42); 2349 2350* Added `0 A.D. <http://play0ad.com/>`_ and `PenUltima Online (POL) 2351 <http://www.polserver.com/>`_ to the list of notable projects using C++ Format. 2352 2353* C++ Format now uses MSVC intrinsics for better formatting performance 2354 (`#115 <https://github.com/fmtlib/fmt/pull/115>`_, 2355 `#116 <https://github.com/fmtlib/fmt/pull/116>`_, 2356 `#118 <https://github.com/fmtlib/fmt/pull/118>`_ and 2357 `#121 <https://github.com/fmtlib/fmt/pull/121>`_). 2358 Previously these optimizations where only used on GCC and Clang. 2359 Thanks to `@CarterLi <https://github.com/CarterLi>`_ and 2360 `@objectx <https://github.com/objectx>`_. 2361 2362* CMake install target (`#119 <https://github.com/fmtlib/fmt/pull/119>`_). 2363 Thanks to `@TrentHouliston <https://github.com/TrentHouliston>`_. 2364 2365 You can now install C++ Format with ``make install`` command. 2366 2367* Improved `Biicode <http://www.biicode.com/>`_ support 2368 (`#98 <https://github.com/fmtlib/fmt/pull/98>`_ and 2369 `#104 <https://github.com/fmtlib/fmt/pull/104>`_). Thanks to 2370 `@MariadeAnton <https://github.com/MariadeAnton>`_ and 2371 `@franramirez688 <https://github.com/franramirez688>`_. 2372 2373* Improved support for building with `Android NDK 2374 <https://developer.android.com/tools/sdk/ndk/index.html>`_ 2375 (`#107 <https://github.com/fmtlib/fmt/pull/107>`_). 2376 Thanks to `@newnon <https://github.com/newnon>`_. 2377 2378 The `android-ndk-example <https://github.com/fmtlib/android-ndk-example>`_ 2379 repository provides and example of using C++ Format with Android NDK: 2380 2381 .. image:: https://raw.githubusercontent.com/fmtlib/android-ndk-example/ 2382 master/screenshot.png 2383 2384* Improved documentation of ``SystemError`` and ``WindowsError`` 2385 (`#54 <https://github.com/fmtlib/fmt/issues/54>`_). 2386 2387* Various code improvements 2388 (`#110 <https://github.com/fmtlib/fmt/pull/110>`_, 2389 `#111 <https://github.com/fmtlib/fmt/pull/111>`_ 2390 `#112 <https://github.com/fmtlib/fmt/pull/112>`_). 2391 Thanks to `@CarterLi <https://github.com/CarterLi>`_. 2392 2393* Improved compile-time errors when formatting wide into narrow strings 2394 (`#117 <https://github.com/fmtlib/fmt/issues/117>`_). 2395 2396* Fixed ``BasicWriter::write`` without formatting arguments when C++11 support 2397 is disabled (`#109 <https://github.com/fmtlib/fmt/issues/109>`_). 2398 2399* Fixed header-only build on OS X with GCC 4.9 2400 (`#124 <https://github.com/fmtlib/fmt/issues/124>`_). 2401 2402* Fixed packaging issues (`#94 <https://github.com/fmtlib/fmt/issues/94>`_). 2403 2404* Added `changelog <https://github.com/fmtlib/fmt/blob/master/ChangeLog.rst>`_ 2405 (`#103 <https://github.com/fmtlib/fmt/issues/103>`_). 2406 24071.0.0 - 2015-02-05 2408------------------ 2409 2410* Add support for a header-only configuration when ``FMT_HEADER_ONLY`` is 2411 defined before including ``format.h``: 2412 2413 .. code:: c++ 2414 2415 #define FMT_HEADER_ONLY 2416 #include "format.h" 2417 2418* Compute string length in the constructor of ``BasicStringRef`` 2419 instead of the ``size`` method 2420 (`#79 <https://github.com/fmtlib/fmt/issues/79>`_). 2421 This eliminates size computation for string literals on reasonable optimizing 2422 compilers. 2423 2424* Fix formatting of types with overloaded ``operator <<`` for ``std::wostream`` 2425 (`#86 <https://github.com/fmtlib/fmt/issues/86>`_): 2426 2427 .. code:: c++ 2428 2429 fmt::format(L"The date is {0}", Date(2012, 12, 9)); 2430 2431* Fix linkage of tests on Arch Linux 2432 (`#89 <https://github.com/fmtlib/fmt/issues/89>`_). 2433 2434* Allow precision specifier for non-float arguments 2435 (`#90 <https://github.com/fmtlib/fmt/issues/90>`_): 2436 2437 .. code:: c++ 2438 2439 fmt::print("{:.3}\n", "Carpet"); // prints "Car" 2440 2441* Fix build on Android NDK 2442 (`#93 <https://github.com/fmtlib/fmt/issues/93>`_) 2443 2444* Improvements to documentation build procedure. 2445 2446* Remove ``FMT_SHARED`` CMake variable in favor of standard `BUILD_SHARED_LIBS 2447 <http://www.cmake.org/cmake/help/v3.0/variable/BUILD_SHARED_LIBS.html>`_. 2448 2449* Fix error handling in ``fmt::fprintf``. 2450 2451* Fix a number of warnings. 2452 24530.12.0 - 2014-10-25 2454------------------- 2455 2456* [Breaking] Improved separation between formatting and buffer management. 2457 ``Writer`` is now a base class that cannot be instantiated directly. 2458 The new ``MemoryWriter`` class implements the default buffer management 2459 with small allocations done on stack. So ``fmt::Writer`` should be replaced 2460 with ``fmt::MemoryWriter`` in variable declarations. 2461 2462 Old code: 2463 2464 .. code:: c++ 2465 2466 fmt::Writer w; 2467 2468 New code: 2469 2470 .. code:: c++ 2471 2472 fmt::MemoryWriter w; 2473 2474 If you pass ``fmt::Writer`` by reference, you can continue to do so: 2475 2476 .. code:: c++ 2477 2478 void f(fmt::Writer &w); 2479 2480 This doesn't affect the formatting API. 2481 2482* Support for custom memory allocators 2483 (`#69 <https://github.com/fmtlib/fmt/issues/69>`_) 2484 2485* Formatting functions now accept `signed char` and `unsigned char` strings as 2486 arguments (`#73 <https://github.com/fmtlib/fmt/issues/73>`_): 2487 2488 .. code:: c++ 2489 2490 auto s = format("GLSL version: {}", glGetString(GL_VERSION)); 2491 2492* Reduced code bloat. According to the new `benchmark results 2493 <https://github.com/fmtlib/fmt#compile-time-and-code-bloat>`_, 2494 cppformat is close to ``printf`` and by the order of magnitude better than 2495 Boost Format in terms of compiled code size. 2496 2497* Improved appearance of the documentation on mobile by using the `Sphinx 2498 Bootstrap theme <http://ryan-roemer.github.io/sphinx-bootstrap-theme/>`_: 2499 2500 .. |old| image:: https://cloud.githubusercontent.com/assets/576385/4792130/ 2501 cd256436-5de3-11e4-9a62-c077d0c2b003.png 2502 2503 .. |new| image:: https://cloud.githubusercontent.com/assets/576385/4792131/ 2504 cd29896c-5de3-11e4-8f59-cac952942bf0.png 2505 2506 +-------+-------+ 2507 | Old | New | 2508 +-------+-------+ 2509 | |old| | |new| | 2510 +-------+-------+ 2511 25120.11.0 - 2014-08-21 2513------------------- 2514 2515* Safe printf implementation with a POSIX extension for positional arguments: 2516 2517 .. code:: c++ 2518 2519 fmt::printf("Elapsed time: %.2f seconds", 1.23); 2520 fmt::printf("%1$s, %3$d %2$s", weekday, month, day); 2521 2522* Arguments of ``char`` type can now be formatted as integers 2523 (Issue `#55 <https://github.com/fmtlib/fmt/issues/55>`_): 2524 2525 .. code:: c++ 2526 2527 fmt::format("0x{0:02X}", 'a'); 2528 2529* Deprecated parts of the API removed. 2530 2531* The library is now built and tested on MinGW with Appveyor in addition to 2532 existing test platforms Linux/GCC, OS X/Clang, Windows/MSVC. 2533 25340.10.0 - 2014-07-01 2535------------------- 2536 2537**Improved API** 2538 2539* All formatting methods are now implemented as variadic functions instead 2540 of using ``operator<<`` for feeding arbitrary arguments into a temporary 2541 formatter object. This works both with C++11 where variadic templates are 2542 used and with older standards where variadic functions are emulated by 2543 providing lightweight wrapper functions defined with the ``FMT_VARIADIC`` 2544 macro. You can use this macro for defining your own portable variadic 2545 functions: 2546 2547 .. code:: c++ 2548 2549 void report_error(const char *format, const fmt::ArgList &args) { 2550 fmt::print("Error: {}"); 2551 fmt::print(format, args); 2552 } 2553 FMT_VARIADIC(void, report_error, const char *) 2554 2555 report_error("file not found: {}", path); 2556 2557 Apart from a more natural syntax, this also improves performance as there 2558 is no need to construct temporary formatter objects and control arguments' 2559 lifetimes. Because the wrapper functions are very lightweight, this doesn't 2560 cause code bloat even in pre-C++11 mode. 2561 2562* Simplified common case of formatting an ``std::string``. Now it requires a 2563 single function call: 2564 2565 .. code:: c++ 2566 2567 std::string s = format("The answer is {}.", 42); 2568 2569 Previously it required 2 function calls: 2570 2571 .. code:: c++ 2572 2573 std::string s = str(Format("The answer is {}.") << 42); 2574 2575 Instead of unsafe ``c_str`` function, ``fmt::Writer`` should be used directly 2576 to bypass creation of ``std::string``: 2577 2578 .. code:: c++ 2579 2580 fmt::Writer w; 2581 w.write("The answer is {}.", 42); 2582 w.c_str(); // returns a C string 2583 2584 This doesn't do dynamic memory allocation for small strings and is less error 2585 prone as the lifetime of the string is the same as for ``std::string::c_str`` 2586 which is well understood (hopefully). 2587 2588* Improved consistency in naming functions that are a part of the public API. 2589 Now all public functions are lowercase following the standard library 2590 conventions. Previously it was a combination of lowercase and 2591 CapitalizedWords. 2592 Issue `#50 <https://github.com/fmtlib/fmt/issues/50>`_. 2593 2594* Old functions are marked as deprecated and will be removed in the next 2595 release. 2596 2597**Other Changes** 2598 2599* Experimental support for printf format specifications (work in progress): 2600 2601 .. code:: c++ 2602 2603 fmt::printf("The answer is %d.", 42); 2604 std::string s = fmt::sprintf("Look, a %s!", "string"); 2605 2606* Support for hexadecimal floating point format specifiers ``a`` and ``A``: 2607 2608 .. code:: c++ 2609 2610 print("{:a}", -42.0); // Prints -0x1.5p+5 2611 print("{:A}", -42.0); // Prints -0X1.5P+5 2612 2613* CMake option ``FMT_SHARED`` that specifies whether to build format as a 2614 shared library (off by default). 2615 26160.9.0 - 2014-05-13 2617------------------ 2618 2619* More efficient implementation of variadic formatting functions. 2620 2621* ``Writer::Format`` now has a variadic overload: 2622 2623 .. code:: c++ 2624 2625 Writer out; 2626 out.Format("Look, I'm {}!", "variadic"); 2627 2628* For efficiency and consistency with other overloads, variadic overload of 2629 the ``Format`` function now returns ``Writer`` instead of ``std::string``. 2630 Use the ``str`` function to convert it to ``std::string``: 2631 2632 .. code:: c++ 2633 2634 std::string s = str(Format("Look, I'm {}!", "variadic")); 2635 2636* Replaced formatter actions with output sinks: ``NoAction`` -> ``NullSink``, 2637 ``Write`` -> ``FileSink``, ``ColorWriter`` -> ``ANSITerminalSink``. 2638 This improves naming consistency and shouldn't affect client code unless 2639 these classes are used directly which should be rarely needed. 2640 2641* Added ``ThrowSystemError`` function that formats a message and throws 2642 ``SystemError`` containing the formatted message and system-specific error 2643 description. For example, the following code 2644 2645 .. code:: c++ 2646 2647 FILE *f = fopen(filename, "r"); 2648 if (!f) 2649 ThrowSystemError(errno, "Failed to open file '{}'") << filename; 2650 2651 will throw ``SystemError`` exception with description 2652 "Failed to open file '<filename>': No such file or directory" if file 2653 doesn't exist. 2654 2655* Support for AppVeyor continuous integration platform. 2656 2657* ``Format`` now throws ``SystemError`` in case of I/O errors. 2658 2659* Improve test infrastructure. Print functions are now tested by redirecting 2660 the output to a pipe. 2661 26620.8.0 - 2014-04-14 2663------------------ 2664 2665* Initial release 2666