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