15.3.0 - 2018-12-28 2------------------ 3 4* Introduced experimental chrono formatting support: 5 6 .. code:: c++ 7 8 #include <fmt/chrono.h> 9 10 int main() { 11 using namespace std::literals::chrono_literals; 12 fmt::print("Default format: {} {}\n", 42s, 100ms); 13 fmt::print("strftime-like format: {:%H:%M:%S}\n", 3h + 15min + 30s); 14 } 15 16 prints:: 17 18 Default format: 42s 100ms 19 strftime-like format: 03:15:30 20 21* Added experimental support for emphasis (bold, italic, underline, 22 strikethrough), colored output to a file stream, and improved colored 23 formatting API 24 (`#961 <https://github.com/fmtlib/fmt/pull/961>`_, 25 `#967 <https://github.com/fmtlib/fmt/pull/967>`_, 26 `#973 <https://github.com/fmtlib/fmt/pull/973>`_): 27 28 .. code:: c++ 29 30 #include <fmt/color.h> 31 32 int main() { 33 print(fg(fmt::color::crimson) | fmt::emphasis::bold, 34 "Hello, {}!\n", "world"); 35 print(fg(fmt::color::floral_white) | bg(fmt::color::slate_gray) | 36 fmt::emphasis::underline, "Hello, {}!\n", "мир"); 37 print(fg(fmt::color::steel_blue) | fmt::emphasis::italic, 38 "Hello, {}!\n", "世界"); 39 } 40 41 prints the following on modern terminals with RGB color support: 42 43 .. image:: https://user-images.githubusercontent.com/576385/ 44 50405788-b66e7500-076e-11e9-9592-7324d1f951d8.png 45 46 Thanks `@Rakete1111 (Nicolas) <https://github.com/Rakete1111>`_. 47 48* Added support for 4-bit terminal colors 49 (`#968 <https://github.com/fmtlib/fmt/issues/968>`_, 50 `#974 <https://github.com/fmtlib/fmt/pull/974>`_) 51 52 .. code:: c++ 53 54 #include <fmt/color.h> 55 56 int main() { 57 print(fg(fmt::terminal_color::red), "stop\n"); 58 } 59 60 Note that these colors vary by terminal: 61 62 .. image:: https://user-images.githubusercontent.com/576385/ 63 50405925-dbfc7e00-0770-11e9-9b85-333fab0af9ac.png 64 65 Thanks `@Rakete1111 (Nicolas) <https://github.com/Rakete1111>`_. 66 67* Parameterized formatting functions on the type of the format string 68 (`#880 <https://github.com/fmtlib/fmt/issues/880>`_, 69 `#881 <https://github.com/fmtlib/fmt/pull/881>`_, 70 `#883 <https://github.com/fmtlib/fmt/pull/883>`_, 71 `#885 <https://github.com/fmtlib/fmt/pull/885>`_, 72 `#897 <https://github.com/fmtlib/fmt/pull/897>`_, 73 `#920 <https://github.com/fmtlib/fmt/issues/920>`_). 74 Any object of type ``S`` that has an overloaded ``to_string_view(const S&)`` 75 returning ``fmt::string_view`` can be used as a format string: 76 77 .. code:: c++ 78 79 namespace my_ns { 80 inline string_view to_string_view(const my_string& s) { 81 return {s.data(), s.length()}; 82 } 83 } 84 85 std::string message = fmt::format(my_string("The answer is {}."), 42); 86 87 Thanks `@DanielaE (Daniela Engert) <https://github.com/DanielaE>`_. 88 89* Made ``std::string_view`` work as a format string 90 (`#898 <https://github.com/fmtlib/fmt/pull/898>`_): 91 92 .. code:: c++ 93 94 auto message = fmt::format(std::string_view("The answer is {}."), 42); 95 96 Thanks `@DanielaE (Daniela Engert) <https://github.com/DanielaE>`_. 97 98* Added wide string support to compile-time format string checks 99 (`#924 <https://github.com/fmtlib/fmt/pull/924>`_): 100 101 .. code:: c++ 102 103 print(fmt(L"{:f}"), 42); // compile-time error: invalid type specifier 104 105 Thanks `@XZiar <https://github.com/XZiar>`_. 106 107* Made colored print functions work with wide strings 108 (`#867 <https://github.com/fmtlib/fmt/pull/867>`_): 109 110 .. code:: c++ 111 112 #include <fmt/color.h> 113 114 int main() { 115 print(fg(fmt::color::red), L"{}\n", 42); 116 } 117 118 Thanks `@DanielaE (Daniela Engert) <https://github.com/DanielaE>`_. 119 120* Introduced experimental Unicode support 121 (`#628 <https://github.com/fmtlib/fmt/issues/628>`_, 122 `#891 <https://github.com/fmtlib/fmt/pull/891>`_): 123 124 .. code:: c++ 125 126 using namespace fmt::literals; 127 auto s = fmt::format("{:*^5}"_u, ""_u); // s == "****"_u 128 129* Improved locale support: 130 131 .. code:: c++ 132 133 #include <fmt/locale.h> 134 135 struct numpunct : std::numpunct<char> { 136 protected: 137 char do_thousands_sep() const override { return '~'; } 138 }; 139 140 std::locale loc; 141 auto s = fmt::format(std::locale(loc, new numpunct()), "{:n}", 1234567); 142 // s == "1~234~567" 143 144* Constrained formatting functions on proper iterator types 145 (`#921 <https://github.com/fmtlib/fmt/pull/921>`_): 146 Thanks `@DanielaE (Daniela Engert) <https://github.com/DanielaE>`_. 147 148* Added ``make_printf_args`` and ``make_wprintf_args`` functions 149 (`#934 <https://github.com/fmtlib/fmt/pull/934>`_). 150 Thanks `@tnovotny <https://github.com/tnovotny>`_. 151 152* Deprecated ``fmt::visit``, ``parse_context``, and ``wparse_context``. 153 Use ``fmt::visit_format_arg``, ``format_parse_context``, and 154 ``wformat_parse_context`` instead. 155 156* Removed undocumented ``basic_fixed_buffer`` which has been superseded by the 157 iterator-based API 158 (`#873 <https://github.com/fmtlib/fmt/issues/873>`_, 159 `#902 <https://github.com/fmtlib/fmt/pull/902>`_). 160 Thanks `@superfunc (hollywood programmer) <https://github.com/superfunc>`_. 161 162* Disallowed repeated leading zeros in an argument ID: 163 164 .. code:: c++ 165 166 fmt::print("{000}", 42); // error 167 168* Reintroduced support for gcc 4.4. 169 170* Fixed compilation on platforms with exotic ``double`` 171 (`#878 <https://github.com/fmtlib/fmt/issues/878>`_). 172 173* Improved documentation 174 (`#164 <https://github.com/fmtlib/fmt/issues/164>`_, 175 `#877 <https://github.com/fmtlib/fmt/issues/877>`_, 176 `#901 <https://github.com/fmtlib/fmt/pull/901>`_, 177 `#906 <https://github.com/fmtlib/fmt/pull/906>`_, 178 `#979 <https://github.com/fmtlib/fmt/pull/979>`_). 179 Thanks `@kookjr (Mathew Cucuzella) <https://github.com/kookjr>`_, 180 `@DarkDimius (Dmitry Petrashko) <https://github.com/DarkDimius>`_, 181 `@HecticSerenity <https://github.com/HecticSerenity>`_. 182 183* Added pkgconfig support which makes it easier to consume the library from 184 meson and other build systems 185 (`#916 <https://github.com/fmtlib/fmt/pull/916>`_). 186 Thanks `@colemickens (Cole Mickens) <https://github.com/colemickens>`_. 187 188* Various build improvements 189 (`#909 <https://github.com/fmtlib/fmt/pull/909>`_, 190 `#926 <https://github.com/fmtlib/fmt/pull/926>`_, 191 `#937 <https://github.com/fmtlib/fmt/pull/937>`_, 192 `#953 <https://github.com/fmtlib/fmt/pull/953>`_, 193 `#959 <https://github.com/fmtlib/fmt/pull/959>`_). 194 Thanks `@tchaikov (Kefu Chai) <https://github.com/tchaikov>`_, 195 `@luncliff (Park DongHa) <https://github.com/luncliff>`_, 196 `@AndreasSchoenle (Andreas Schönle) <https://github.com/AndreasSchoenle>`_, 197 `@hotwatermorning <https://github.com/hotwatermorning>`_, 198 `@Zefz (JohanJansen) <https://github.com/Zefz>`_. 199 200* Improved ``string_view`` construction performance 201 (`#914 <https://github.com/fmtlib/fmt/pull/914>`_). 202 Thanks `@gabime (Gabi Melman) <https://github.com/gabime>`_. 203 204* Fixed non-matching char types 205 (`#895 <https://github.com/fmtlib/fmt/pull/895>`_). 206 Thanks `@DanielaE (Daniela Engert) <https://github.com/DanielaE>`_. 207 208* Fixed ``format_to_n`` with ``std::back_insert_iterator`` 209 (`#913 <https://github.com/fmtlib/fmt/pull/913>`_). 210 Thanks `@DanielaE (Daniela Engert) <https://github.com/DanielaE>`_. 211 212* Fixed locale-dependent formatting 213 (`#905 <https://github.com/fmtlib/fmt/issues/905>`_). 214 215* Fixed various compiler warnings and errors 216 (`#882 <https://github.com/fmtlib/fmt/pull/882>`_, 217 `#886 <https://github.com/fmtlib/fmt/pull/886>`_, 218 `#933 <https://github.com/fmtlib/fmt/pull/933>`_, 219 `#941 <https://github.com/fmtlib/fmt/pull/941>`_, 220 `#931 <https://github.com/fmtlib/fmt/issues/931>`_, 221 `#943 <https://github.com/fmtlib/fmt/pull/943>`_, 222 `#954 <https://github.com/fmtlib/fmt/pull/954>`_, 223 `#956 <https://github.com/fmtlib/fmt/pull/956>`_, 224 `#962 <https://github.com/fmtlib/fmt/pull/962>`_, 225 `#965 <https://github.com/fmtlib/fmt/issues/965>`_, 226 `#977 <https://github.com/fmtlib/fmt/issues/977>`_, 227 `#983 <https://github.com/fmtlib/fmt/pull/983>`_, 228 `#989 <https://github.com/fmtlib/fmt/pull/989>`_). 229 Thanks `@Luthaf (Guillaume Fraux) <https://github.com/Luthaf>`_, 230 `@stevenhoving (Steven Hoving) <https://github.com/stevenhoving>`_, 231 `@christinaa (Kristina Brooks) <https://github.com/christinaa>`_, 232 `@lgritz (Larry Gritz) <https://github.com/lgritz>`_, 233 `@DanielaE (Daniela Engert) <https://github.com/DanielaE>`_, 234 `@0x8000-0000 (Sign Bit) <https://github.com/0x8000-0000>`_, 235 `@liuping1997 <https://github.com/liuping1997>`_. 236 2375.2.1 - 2018-09-21 238------------------ 239 240* Fixed ``visit`` lookup issues on gcc 7 & 8 241 (`#870 <https://github.com/fmtlib/fmt/pull/870>`_). 242 Thanks `@medithe <https://github.com/medithe>`_. 243 244* Fixed linkage errors on older gcc. 245 246* Prevented ``fmt/range.h`` from specializing ``fmt::basic_string_view`` 247 (`#865 <https://github.com/fmtlib/fmt/issues/865>`_, 248 `#868 <https://github.com/fmtlib/fmt/pull/868>`_). 249 Thanks `@hhggit (dual) <https://github.com/hhggit>`_. 250 251* Improved error message when formatting unknown types 252 (`#872 <https://github.com/fmtlib/fmt/pull/872>`_). 253 Thanks `@foonathan (Jonathan Müller) <https://github.com/foonathan>`_, 254 255* Disabled templated user-defined literals when compiled under nvcc 256 (`#875 <https://github.com/fmtlib/fmt/pull/875>`_). 257 Thanks `@CandyGumdrop (Candy Gumdrop) <https://github.com/CandyGumdrop>`_, 258 259* Fixed ``format_to`` formatting to ``wmemory_buffer`` 260 (`#874 <https://github.com/fmtlib/fmt/issues/874>`_). 261 2625.2.0 - 2018-09-13 263------------------ 264 265* Optimized format string parsing and argument processing which resulted in up 266 to 5x speed up on long format strings and significant performance boost on 267 various benchmarks. For example, version 5.2 is 2.22x faster than 5.1 on 268 decimal integer formatting with ``format_to`` (macOS, clang-902.0.39.2): 269 270 ================== ======= ======= 271 Method Time, s Speedup 272 ================== ======= ======= 273 fmt::format 5.1 0.58 274 fmt::format 5.2 0.35 1.66x 275 fmt::format_to 5.1 0.51 276 fmt::format_to 5.2 0.23 2.22x 277 sprintf 0.71 278 std::to_string 1.01 279 std::stringstream 1.73 280 ================== ======= ======= 281 282* Changed the ``fmt`` macro from opt-out to opt-in to prevent name collisions. 283 To enable it define the ``FMT_STRING_ALIAS`` macro to 1 before including 284 ``fmt/format.h``: 285 286 .. code:: c++ 287 288 #define FMT_STRING_ALIAS 1 289 #include <fmt/format.h> 290 std::string answer = format(fmt("{}"), 42); 291 292* Added compile-time format string checks to ``format_to`` overload that takes 293 ``fmt::memory_buffer`` (`#783 <https://github.com/fmtlib/fmt/issues/783>`_): 294 295 .. code:: c++ 296 297 fmt::memory_buffer buf; 298 // Compile-time error: invalid type specifier. 299 fmt::format_to(buf, fmt("{:d}"), "foo"); 300 301* Moved experimental color support to ``fmt/color.h`` and enabled the 302 new API by default. The old API can be enabled by defining the 303 ``FMT_DEPRECATED_COLORS`` macro. 304 305* Added formatting support for types explicitly convertible to 306 ``fmt::string_view``: 307 308 .. code:: c++ 309 310 struct foo { 311 explicit operator fmt::string_view() const { return "foo"; } 312 }; 313 auto s = format("{}", foo()); 314 315 In particular, this makes formatting function work with 316 ``folly::StringPiece``. 317 318* Implemented preliminary support for ``char*_t`` by replacing the ``format`` 319 function overloads with a single function template parameterized on the string 320 type. 321 322* Added support for dynamic argument lists 323 (`#814 <https://github.com/fmtlib/fmt/issues/814>`_, 324 `#819 <https://github.com/fmtlib/fmt/pull/819>`_). 325 Thanks `@MikePopoloski (Michael Popoloski) 326 <https://github.com/MikePopoloski>`_. 327 328* Reduced executable size overhead for embedded targets using newlib nano by 329 making locale dependency optional 330 (`#839 <https://github.com/fmtlib/fmt/pull/839>`_). 331 Thanks `@teajay-fr (Thomas Benard) <https://github.com/teajay-fr>`_. 332 333* Keep ``noexcept`` specifier when exceptions are disabled 334 (`#801 <https://github.com/fmtlib/fmt/issues/801>`_, 335 `#810 <https://github.com/fmtlib/fmt/pull/810>`_). 336 Thanks `@qis (Alexej Harm) <https://github.com/qis>`_. 337 338* Fixed formatting of user-defined types providing ``operator<<`` with 339 ``format_to_n`` 340 (`#806 <https://github.com/fmtlib/fmt/pull/806>`_). 341 Thanks `@mkurdej (Marek Kurdej) <https://github.com/mkurdej>`_. 342 343* Fixed dynamic linkage of new symbols 344 (`#808 <https://github.com/fmtlib/fmt/issues/808>`_). 345 346* Fixed global initialization issue 347 (`#807 <https://github.com/fmtlib/fmt/issues/807>`_): 348 349 .. code:: c++ 350 351 // This works on compilers with constexpr support. 352 static const std::string answer = fmt::format("{}", 42); 353 354* Fixed various compiler warnings and errors 355 (`#804 <https://github.com/fmtlib/fmt/pull/804>`_, 356 `#809 <https://github.com/fmtlib/fmt/issues/809>`_, 357 `#811 <https://github.com/fmtlib/fmt/pull/811>`_, 358 `#822 <https://github.com/fmtlib/fmt/issues/822>`_, 359 `#827 <https://github.com/fmtlib/fmt/pull/827>`_, 360 `#830 <https://github.com/fmtlib/fmt/issues/830>`_, 361 `#838 <https://github.com/fmtlib/fmt/pull/838>`_, 362 `#843 <https://github.com/fmtlib/fmt/issues/843>`_, 363 `#844 <https://github.com/fmtlib/fmt/pull/844>`_, 364 `#851 <https://github.com/fmtlib/fmt/issues/851>`_, 365 `#852 <https://github.com/fmtlib/fmt/pull/852>`_, 366 `#854 <https://github.com/fmtlib/fmt/pull/854>`_). 367 Thanks `@henryiii (Henry Schreiner) <https://github.com/henryiii>`_, 368 `@medithe <https://github.com/medithe>`_, and 369 `@eliasdaler (Elias Daler) <https://github.com/eliasdaler>`_. 370 3715.1.0 - 2018-07-05 372------------------ 373 374* Added experimental support for RGB color output enabled with 375 the ``FMT_EXTENDED_COLORS`` macro: 376 377 .. code:: c++ 378 379 #define FMT_EXTENDED_COLORS 380 #define FMT_HEADER_ONLY // or compile fmt with FMT_EXTENDED_COLORS defined 381 #include <fmt/format.h> 382 383 fmt::print(fmt::color::steel_blue, "Some beautiful text"); 384 385 The old API (the ``print_colored`` and ``vprint_colored`` functions and the 386 ``color`` enum) is now deprecated. 387 (`#762 <https://github.com/fmtlib/fmt/issues/762>`_ 388 `#767 <https://github.com/fmtlib/fmt/pull/767>`_). 389 thanks `@remotion (remo) <https://github.com/remotion>`_. 390 391* Added quotes to strings in ranges and tuples 392 (`#766 <https://github.com/fmtlib/fmt/pull/766>`_). 393 Thanks `@Remotion (Remo) <https://github.com/Remotion>`_. 394 395* Made ``format_to`` work with ``basic_memory_buffer`` 396 (`#776 <https://github.com/fmtlib/fmt/issues/776>`_). 397 398* Added ``vformat_to_n`` and ``wchar_t`` overload of ``format_to_n`` 399 (`#764 <https://github.com/fmtlib/fmt/issues/764>`_, 400 `#769 <https://github.com/fmtlib/fmt/issues/769>`_). 401 402* Made ``is_range`` and ``is_tuple_like`` part of public (experimental) API 403 to allow specialization for user-defined types 404 (`#751 <https://github.com/fmtlib/fmt/issues/751>`_, 405 `#759 <https://github.com/fmtlib/fmt/pull/759>`_). 406 Thanks `@drrlvn (Dror Levin) <https://github.com/drrlvn>`_. 407 408* Added more compilers to continuous integration and increased ``FMT_PEDANTIC`` 409 warning levels 410 (`#736 <https://github.com/fmtlib/fmt/pull/736>`_). 411 Thanks `@eliaskosunen (Elias Kosunen) <https://github.com/eliaskosunen>`_. 412 413* Fixed compilation with MSVC 2013. 414 415* Fixed handling of user-defined types in ``format_to`` 416 (`#793 <https://github.com/fmtlib/fmt/issues/793>`_). 417 418* Forced linking of inline ``vformat`` functions into the library 419 (`#795 <https://github.com/fmtlib/fmt/issues/795>`_). 420 421* Fixed incorrect call to on_align in ``'{:}='`` 422 (`#750 <https://github.com/fmtlib/fmt/issues/750>`_). 423 424* Fixed floating-point formatting to a non-back_insert_iterator with sign & 425 numeric alignment specified 426 (`#756 <https://github.com/fmtlib/fmt/issues/756>`_). 427 428* Fixed formatting to an array with ``format_to_n`` 429 (`#778 <https://github.com/fmtlib/fmt/issues/778>`_). 430 431* Fixed formatting of more than 15 named arguments 432 (`#754 <https://github.com/fmtlib/fmt/issues/754>`_). 433 434* Fixed handling of compile-time strings when including ``fmt/ostream.h``. 435 (`#768 <https://github.com/fmtlib/fmt/issues/768>`_). 436 437* Fixed various compiler warnings and errors 438 (`#742 <https://github.com/fmtlib/fmt/issues/742>`_, 439 `#748 <https://github.com/fmtlib/fmt/issues/748>`_, 440 `#752 <https://github.com/fmtlib/fmt/issues/752>`_, 441 `#770 <https://github.com/fmtlib/fmt/issues/770>`_, 442 `#775 <https://github.com/fmtlib/fmt/pull/775>`_, 443 `#779 <https://github.com/fmtlib/fmt/issues/779>`_, 444 `#780 <https://github.com/fmtlib/fmt/pull/780>`_, 445 `#790 <https://github.com/fmtlib/fmt/pull/790>`_, 446 `#792 <https://github.com/fmtlib/fmt/pull/792>`_, 447 `#800 <https://github.com/fmtlib/fmt/pull/800>`_). 448 Thanks `@Remotion (Remo) <https://github.com/Remotion>`_, 449 `@gabime (Gabi Melman) <https://github.com/gabime>`_, 450 `@foonathan (Jonathan Müller) <https://github.com/foonathan>`_, 451 `@Dark-Passenger (Dhruv Paranjape) <https://github.com/Dark-Passenger>`_, and 452 `@0x8000-0000 (Sign Bit) <https://github.com/0x8000-0000>`_. 453 4545.0.0 - 2018-05-21 455------------------ 456 457* Added a requirement for partial C++11 support, most importantly variadic 458 templates and type traits, and dropped ``FMT_VARIADIC_*`` emulation macros. 459 Variadic templates are available since GCC 4.4, Clang 2.9 and MSVC 18.0 (2013). 460 For older compilers use {fmt} `version 4.x 461 <https://github.com/fmtlib/fmt/releases/tag/4.1.0>`_ which continues to be 462 maintained and works with C++98 compilers. 463 464* Renamed symbols to follow standard C++ naming conventions and proposed a subset 465 of the library for standardization in `P0645R2 Text Formatting 466 <https://wg21.link/P0645>`_. 467 468* Implemented ``constexpr`` parsing of format strings and `compile-time format 469 string checks 470 <http://fmtlib.net/dev/api.html#compile-time-format-string-checks>`_. For 471 example 472 473 .. code:: c++ 474 475 #include <fmt/format.h> 476 477 std::string s = format(fmt("{:d}"), "foo"); 478 479 gives a compile-time error because ``d`` is an invalid specifier for strings 480 (`godbolt <https://godbolt.org/g/rnCy9Q>`__):: 481 482 ... 483 <source>:4:19: note: in instantiation of function template specialization 'fmt::v5::format<S, char [4]>' requested here 484 std::string s = format(fmt("{:d}"), "foo"); 485 ^ 486 format.h:1337:13: note: non-constexpr function 'on_error' cannot be used in a constant expression 487 handler.on_error("invalid type specifier"); 488 489 Compile-time checks require relaxed ``constexpr`` (C++14 feature) support. If 490 the latter is not available, checks will be performed at runtime. 491 492* Separated format string parsing and formatting in the extension API to enable 493 compile-time format string processing. For example 494 495 .. code:: c++ 496 497 struct Answer {}; 498 499 namespace fmt { 500 template <> 501 struct formatter<Answer> { 502 constexpr auto parse(parse_context& ctx) { 503 auto it = ctx.begin(); 504 spec = *it; 505 if (spec != 'd' && spec != 's') 506 throw format_error("invalid specifier"); 507 return ++it; 508 } 509 510 template <typename FormatContext> 511 auto format(Answer, FormatContext& ctx) { 512 return spec == 's' ? 513 format_to(ctx.begin(), "{}", "fourty-two") : 514 format_to(ctx.begin(), "{}", 42); 515 } 516 517 char spec = 0; 518 }; 519 } 520 521 std::string s = format(fmt("{:x}"), Answer()); 522 523 gives a compile-time error due to invalid format specifier (`godbolt 524 <https://godbolt.org/g/2jQ1Dv>`__):: 525 526 ... 527 <source>:12:45: error: expression '<throw-expression>' is not a constant expression 528 throw format_error("invalid specifier"); 529 530* Added `iterator support 531 <http://fmtlib.net/dev/api.html#output-iterator-support>`_: 532 533 .. code:: c++ 534 535 #include <vector> 536 #include <fmt/format.h> 537 538 std::vector<char> out; 539 fmt::format_to(std::back_inserter(out), "{}", 42); 540 541* Added the `format_to_n 542 <http://fmtlib.net/dev/api.html#_CPPv2N3fmt11format_to_nE8OutputItNSt6size_tE11string_viewDpRK4Args>`_ 543 function that restricts the output to the specified number of characters 544 (`#298 <https://github.com/fmtlib/fmt/issues/298>`_): 545 546 .. code:: c++ 547 548 char out[4]; 549 fmt::format_to_n(out, sizeof(out), "{}", 12345); 550 // out == "1234" (without terminating '\0') 551 552* Added the `formatted_size 553 <http://fmtlib.net/dev/api.html#_CPPv2N3fmt14formatted_sizeE11string_viewDpRK4Args>`_ 554 function for computing the output size: 555 556 .. code:: c++ 557 558 #include <fmt/format.h> 559 560 auto size = fmt::formatted_size("{}", 12345); // size == 5 561 562* Improved compile times by reducing dependencies on standard headers and 563 providing a lightweight `core API <http://fmtlib.net/dev/api.html#core-api>`_: 564 565 .. code:: c++ 566 567 #include <fmt/core.h> 568 569 fmt::print("The answer is {}.", 42); 570 571 See `Compile time and code bloat 572 <https://github.com/fmtlib/fmt#compile-time-and-code-bloat>`_. 573 574* Added the `make_format_args 575 <http://fmtlib.net/dev/api.html#_CPPv2N3fmt16make_format_argsEDpRK4Args>`_ 576 function for capturing formatting arguments: 577 578 .. code:: c++ 579 580 // Prints formatted error message. 581 void vreport_error(const char *format, fmt::format_args args) { 582 fmt::print("Error: "); 583 fmt::vprint(format, args); 584 } 585 template <typename... Args> 586 void report_error(const char *format, const Args & ... args) { 587 vreport_error(format, fmt::make_format_args(args...)); 588 } 589 590* Added the ``make_printf_args`` function for capturing ``printf`` arguments 591 (`#687 <https://github.com/fmtlib/fmt/issues/687>`_, 592 `#694 <https://github.com/fmtlib/fmt/pull/694>`_). 593 Thanks `@Kronuz (Germán Méndez Bravo) <https://github.com/Kronuz>`_. 594 595* Added prefix ``v`` to non-variadic functions taking ``format_args`` to 596 distinguish them from variadic ones: 597 598 .. code:: c++ 599 600 std::string vformat(string_view format_str, format_args args); 601 602 template <typename... Args> 603 std::string format(string_view format_str, const Args & ... args); 604 605* Added experimental support for formatting ranges, containers and tuple-like 606 types in ``fmt/ranges.h`` (`#735 <https://github.com/fmtlib/fmt/pull/735>`_): 607 608 .. code:: c++ 609 610 #include <fmt/ranges.h> 611 612 std::vector<int> v = {1, 2, 3}; 613 fmt::print("{}", v); // prints {1, 2, 3} 614 615 Thanks `@Remotion (Remo) <https://github.com/Remotion>`_. 616 617* Implemented ``wchar_t`` date and time formatting 618 (`#712 <https://github.com/fmtlib/fmt/pull/712>`_): 619 620 .. code:: c++ 621 622 #include <fmt/time.h> 623 624 std::time_t t = std::time(nullptr); 625 auto s = fmt::format(L"The date is {:%Y-%m-%d}.", *std::localtime(&t)); 626 627 Thanks `@DanielaE (Daniela Engert) <https://github.com/DanielaE>`_. 628 629* Provided more wide string overloads 630 (`#724 <https://github.com/fmtlib/fmt/pull/724>`_). 631 Thanks `@DanielaE (Daniela Engert) <https://github.com/DanielaE>`_. 632 633* Switched from a custom null-terminated string view class to ``string_view`` 634 in the format API and provided ``fmt::string_view`` which implements a subset 635 of ``std::string_view`` API for pre-C++17 systems. 636 637* Added support for ``std::experimental::string_view`` 638 (`#607 <https://github.com/fmtlib/fmt/pull/607>`_): 639 640 .. code:: c++ 641 642 #include <fmt/core.h> 643 #include <experimental/string_view> 644 645 fmt::print("{}", std::experimental::string_view("foo")); 646 647 Thanks `@virgiliofornazin (Virgilio Alexandre Fornazin) 648 <https://github.com/virgiliofornazin>`__. 649 650* Allowed mixing named and automatic arguments: 651 652 .. code:: c++ 653 654 fmt::format("{} {two}", 1, fmt::arg("two", 2)); 655 656* Removed the write API in favor of the `format API 657 <http://fmtlib.net/dev/api.html#format-api>`_ with compile-time handling of 658 format strings. 659 660* Disallowed formatting of multibyte strings into a wide character target 661 (`#606 <https://github.com/fmtlib/fmt/pull/606>`_). 662 663* Improved documentation 664 (`#515 <https://github.com/fmtlib/fmt/pull/515>`_, 665 `#614 <https://github.com/fmtlib/fmt/issues/614>`_, 666 `#617 <https://github.com/fmtlib/fmt/pull/617>`_, 667 `#661 <https://github.com/fmtlib/fmt/pull/661>`_, 668 `#680 <https://github.com/fmtlib/fmt/pull/680>`_). 669 Thanks `@ibell (Ian Bell) <https://github.com/ibell>`_, 670 `@mihaitodor (Mihai Todor) <https://github.com/mihaitodor>`_, and 671 `@johnthagen <https://github.com/johnthagen>`_. 672 673* Implemented more efficient handling of large number of format arguments. 674 675* Introduced an inline namespace for symbol versioning. 676 677* Added debug postfix ``d`` to the ``fmt`` library name 678 (`#636 <https://github.com/fmtlib/fmt/issues/636>`_). 679 680* Removed unnecessary ``fmt/`` prefix in includes 681 (`#397 <https://github.com/fmtlib/fmt/pull/397>`_). 682 Thanks `@chronoxor (Ivan Shynkarenka) <https://github.com/chronoxor>`_. 683 684* Moved ``fmt/*.h`` to ``include/fmt/*.h`` to prevent irrelevant files and 685 directories appearing on the include search paths when fmt is used as a 686 subproject and moved source files to the ``src`` directory. 687 688* Added qmake project file ``support/fmt.pro`` 689 (`#641 <https://github.com/fmtlib/fmt/pull/641>`_). 690 Thanks `@cowo78 (Giuseppe Corbelli) <https://github.com/cowo78>`_. 691 692* Added Gradle build file ``support/build.gradle`` 693 (`#649 <https://github.com/fmtlib/fmt/pull/649>`_). 694 Thanks `@luncliff (Park DongHa) <https://github.com/luncliff>`_. 695 696* Removed ``FMT_CPPFORMAT`` CMake option. 697 698* Fixed a name conflict with the macro ``CHAR_WIDTH`` in glibc 699 (`#616 <https://github.com/fmtlib/fmt/pull/616>`_). 700 Thanks `@aroig (Abdó Roig-Maranges) <https://github.com/aroig>`_. 701 702* Fixed handling of nested braces in ``fmt::join`` 703 (`#638 <https://github.com/fmtlib/fmt/issues/638>`_). 704 705* Added ``SOURCELINK_SUFFIX`` for compatibility with Sphinx 1.5 706 (`#497 <https://github.com/fmtlib/fmt/pull/497>`_). 707 Thanks `@ginggs (Graham Inggs) <https://github.com/ginggs>`_. 708 709* Added a missing ``inline`` in the header-only mode 710 (`#626 <https://github.com/fmtlib/fmt/pull/626>`_). 711 Thanks `@aroig (Abdó Roig-Maranges) <https://github.com/aroig>`_. 712 713* Fixed various compiler warnings 714 (`#640 <https://github.com/fmtlib/fmt/pull/640>`_, 715 `#656 <https://github.com/fmtlib/fmt/pull/656>`_, 716 `#679 <https://github.com/fmtlib/fmt/pull/679>`_, 717 `#681 <https://github.com/fmtlib/fmt/pull/681>`_, 718 `#705 <https://github.com/fmtlib/fmt/pull/705>`__, 719 `#715 <https://github.com/fmtlib/fmt/issues/715>`_, 720 `#717 <https://github.com/fmtlib/fmt/pull/717>`_, 721 `#720 <https://github.com/fmtlib/fmt/pull/720>`_, 722 `#723 <https://github.com/fmtlib/fmt/pull/723>`_, 723 `#726 <https://github.com/fmtlib/fmt/pull/726>`_, 724 `#730 <https://github.com/fmtlib/fmt/pull/730>`_, 725 `#739 <https://github.com/fmtlib/fmt/pull/739>`_). 726 Thanks `@peterbell10 <https://github.com/peterbell10>`_, 727 `@LarsGullik <https://github.com/LarsGullik>`_, 728 `@foonathan (Jonathan Müller) <https://github.com/foonathan>`_, 729 `@eliaskosunen (Elias Kosunen) <https://github.com/eliaskosunen>`_, 730 `@christianparpart (Christian Parpart) <https://github.com/christianparpart>`_, 731 `@DanielaE (Daniela Engert) <https://github.com/DanielaE>`_, 732 and `@mwinterb <https://github.com/mwinterb>`_. 733 734* Worked around an MSVC bug and fixed several warnings 735 (`#653 <https://github.com/fmtlib/fmt/pull/653>`_). 736 Thanks `@alabuzhev (Alex Alabuzhev) <https://github.com/alabuzhev>`_. 737 738* Worked around GCC bug 67371 739 (`#682 <https://github.com/fmtlib/fmt/issues/682>`_). 740 741* Fixed compilation with ``-fno-exceptions`` 742 (`#655 <https://github.com/fmtlib/fmt/pull/655>`_). 743 Thanks `@chenxiaolong (Andrew Gunnerson) <https://github.com/chenxiaolong>`_. 744 745* Made ``constexpr remove_prefix`` gcc version check tighter 746 (`#648 <https://github.com/fmtlib/fmt/issues/648>`_). 747 748* Renamed internal type enum constants to prevent collision with poorly written 749 C libraries (`#644 <https://github.com/fmtlib/fmt/issues/644>`_). 750 751* Added detection of ``wostream operator<<`` 752 (`#650 <https://github.com/fmtlib/fmt/issues/650>`_). 753 754* Fixed compilation on OpenBSD 755 (`#660 <https://github.com/fmtlib/fmt/pull/660>`_). 756 Thanks `@hubslave <https://github.com/hubslave>`_. 757 758* Fixed compilation on FreeBSD 12 759 (`#732 <https://github.com/fmtlib/fmt/pull/732>`_). 760 Thanks `@dankm <https://github.com/dankm>`_. 761 762* Fixed compilation when there is a mismatch between ``-std`` options between 763 the library and user code 764 (`#664 <https://github.com/fmtlib/fmt/issues/664>`_). 765 766* Fixed compilation with GCC 7 and ``-std=c++11`` 767 (`#734 <https://github.com/fmtlib/fmt/issues/734>`_). 768 769* Improved generated binary code on GCC 7 and older 770 (`#668 <https://github.com/fmtlib/fmt/issues/668>`_). 771 772* Fixed handling of numeric alignment with no width 773 (`#675 <https://github.com/fmtlib/fmt/issues/675>`_). 774 775* Fixed handling of empty strings in UTF8/16 converters 776 (`#676 <https://github.com/fmtlib/fmt/pull/676>`_). 777 Thanks `@vgalka-sl (Vasili Galka) <https://github.com/vgalka-sl>`_. 778 779* Fixed formatting of an empty ``string_view`` 780 (`#689 <https://github.com/fmtlib/fmt/issues/689>`_). 781 782* Fixed detection of ``string_view`` on libc++ 783 (`#686 <https://github.com/fmtlib/fmt/issues/686>`_). 784 785* Fixed DLL issues (`#696 <https://github.com/fmtlib/fmt/pull/696>`_). 786 Thanks `@sebkoenig <https://github.com/sebkoenig>`_. 787 788* Fixed compile checks for mixing narrow and wide strings 789 (`#690 <https://github.com/fmtlib/fmt/issues/690>`_). 790 791* Disabled unsafe implicit conversion to ``std::string`` 792 (`#729 <https://github.com/fmtlib/fmt/issues/729>`_). 793 794* Fixed handling of reused format specs (as in ``fmt::join``) for pointers 795 (`#725 <https://github.com/fmtlib/fmt/pull/725>`_). 796 Thanks `@mwinterb <https://github.com/mwinterb>`_. 797 798* Fixed installation of ``fmt/ranges.h`` 799 (`#738 <https://github.com/fmtlib/fmt/pull/738>`_). 800 Thanks `@sv1990 <https://github.com/sv1990>`_. 801 8024.1.0 - 2017-12-20 803------------------ 804 805* Added ``fmt::to_wstring()`` in addition to ``fmt::to_string()`` 806 (`#559 <https://github.com/fmtlib/fmt/pull/559>`_). 807 Thanks `@alabuzhev (Alex Alabuzhev) <https://github.com/alabuzhev>`_. 808 809* Added support for C++17 ``std::string_view`` 810 (`#571 <https://github.com/fmtlib/fmt/pull/571>`_ and 811 `#578 <https://github.com/fmtlib/fmt/pull/578>`_). 812 Thanks `@thelostt (Mário Feroldi) <https://github.com/thelostt>`_ and 813 `@mwinterb <https://github.com/mwinterb>`_. 814 815* Enabled stream exceptions to catch errors 816 (`#581 <https://github.com/fmtlib/fmt/issues/581>`_). 817 Thanks `@crusader-mike <https://github.com/crusader-mike>`_. 818 819* Allowed formatting of class hierarchies with ``fmt::format_arg()`` 820 (`#547 <https://github.com/fmtlib/fmt/pull/547>`_). 821 Thanks `@rollbear (Björn Fahller) <https://github.com/rollbear>`_. 822 823* Removed limitations on character types 824 (`#563 <https://github.com/fmtlib/fmt/pull/563>`_). 825 Thanks `@Yelnats321 (Elnar Dakeshov) <https://github.com/Yelnats321>`_. 826 827* Conditionally enabled use of ``std::allocator_traits`` 828 (`#583 <https://github.com/fmtlib/fmt/pull/583>`_). 829 Thanks `@mwinterb <https://github.com/mwinterb>`_. 830 831* Added support for ``const`` variadic member function emulation with 832 ``FMT_VARIADIC_CONST`` (`#591 <https://github.com/fmtlib/fmt/pull/591>`_). 833 Thanks `@ludekvodicka (Ludek Vodicka) <https://github.com/ludekvodicka>`_. 834 835* Various bugfixes: bad overflow check, unsupported implicit type conversion 836 when determining formatting function, test segfaults 837 (`#551 <https://github.com/fmtlib/fmt/issues/551>`_), ill-formed macros 838 (`#542 <https://github.com/fmtlib/fmt/pull/542>`_) and ambiguous overloads 839 (`#580 <https://github.com/fmtlib/fmt/issues/580>`_). 840 Thanks `@xylosper (Byoung-young Lee) <https://github.com/xylosper>`_. 841 842* Prevented warnings on MSVC (`#605 <https://github.com/fmtlib/fmt/pull/605>`_, 843 `#602 <https://github.com/fmtlib/fmt/pull/602>`_, and 844 `#545 <https://github.com/fmtlib/fmt/pull/545>`_), 845 clang (`#582 <https://github.com/fmtlib/fmt/pull/582>`_), 846 GCC (`#573 <https://github.com/fmtlib/fmt/issues/573>`_), 847 various conversion warnings (`#609 <https://github.com/fmtlib/fmt/pull/609>`_, 848 `#567 <https://github.com/fmtlib/fmt/pull/567>`_, 849 `#553 <https://github.com/fmtlib/fmt/pull/553>`_ and 850 `#553 <https://github.com/fmtlib/fmt/pull/553>`_), and added ``override`` and 851 ``[[noreturn]]`` (`#549 <https://github.com/fmtlib/fmt/pull/549>`_ and 852 `#555 <https://github.com/fmtlib/fmt/issues/555>`_). 853 Thanks `@alabuzhev (Alex Alabuzhev) <https://github.com/alabuzhev>`_, 854 `@virgiliofornazin (Virgilio Alexandre Fornazin) 855 <https://gihtub.com/virgiliofornazin>`_, 856 `@alexanderbock (Alexander Bock) <https://github.com/alexanderbock>`_, 857 `@yumetodo <https://github.com/yumetodo>`_, 858 `@VaderY (Császár Mátyás) <https://github.com/VaderY>`_, 859 `@jpcima (JP Cimalando) <https://github.com/jpcima>`_, 860 `@thelostt (Mário Feroldi) <https://github.com/thelostt>`_, and 861 `@Manu343726 (Manu Sánchez) <https://github.com/Manu343726>`_. 862 863* Improved CMake: Used ``GNUInstallDirs`` to set installation location 864 (`#610 <https://github.com/fmtlib/fmt/pull/610>`_) and fixed warnings 865 (`#536 <https://github.com/fmtlib/fmt/pull/536>`_ and 866 `#556 <https://github.com/fmtlib/fmt/pull/556>`_). 867 Thanks `@mikecrowe (Mike Crowe) <https://github.com/mikecrowe>`_, 868 `@evgen231 <https://github.com/evgen231>`_ and 869 `@henryiii (Henry Schreiner) <https://github.com/henryiii>`_. 870 8714.0.0 - 2017-06-27 872------------------ 873 874* Removed old compatibility headers ``cppformat/*.h`` and CMake options 875 (`#527 <https://github.com/fmtlib/fmt/pull/527>`_). 876 Thanks `@maddinat0r (Alex Martin) <https://github.com/maddinat0r>`_. 877 878* Added ``string.h`` containing ``fmt::to_string()`` as alternative to 879 ``std::to_string()`` as well as other string writer functionality 880 (`#326 <https://github.com/fmtlib/fmt/issues/326>`_ and 881 `#441 <https://github.com/fmtlib/fmt/pull/441>`_): 882 883 .. code:: c++ 884 885 #include "fmt/string.h" 886 887 std::string answer = fmt::to_string(42); 888 889 Thanks to `@glebov-andrey (Andrey Glebov) 890 <https://github.com/glebov-andrey>`_. 891 892* Moved ``fmt::printf()`` to new ``printf.h`` header and allowed ``%s`` as 893 generic specifier (`#453 <https://github.com/fmtlib/fmt/pull/453>`_), 894 made ``%.f`` more conformant to regular ``printf()`` 895 (`#490 <https://github.com/fmtlib/fmt/pull/490>`_), added custom writer 896 support (`#476 <https://github.com/fmtlib/fmt/issues/476>`_) and implemented 897 missing custom argument formatting 898 (`#339 <https://github.com/fmtlib/fmt/pull/339>`_ and 899 `#340 <https://github.com/fmtlib/fmt/pull/340>`_): 900 901 .. code:: c++ 902 903 #include "fmt/printf.h" 904 905 // %s format specifier can be used with any argument type. 906 fmt::printf("%s", 42); 907 908 Thanks `@mojoBrendan <https://github.com/mojoBrendan>`_, 909 `@manylegged (Arthur Danskin) <https://github.com/manylegged>`_ and 910 `@spacemoose (Glen Stark) <https://github.com/spacemoose>`_. 911 See also `#360 <https://github.com/fmtlib/fmt/issues/360>`_, 912 `#335 <https://github.com/fmtlib/fmt/issues/335>`_ and 913 `#331 <https://github.com/fmtlib/fmt/issues/331>`_. 914 915* Added ``container.h`` containing a ``BasicContainerWriter`` 916 to write to containers like ``std::vector`` 917 (`#450 <https://github.com/fmtlib/fmt/pull/450>`_). 918 Thanks `@polyvertex (Jean-Charles Lefebvre) <https://github.com/polyvertex>`_. 919 920* Added ``fmt::join()`` function that takes a range and formats 921 its elements separated by a given string 922 (`#466 <https://github.com/fmtlib/fmt/pull/466>`_): 923 924 .. code:: c++ 925 926 #include "fmt/format.h" 927 928 std::vector<double> v = {1.2, 3.4, 5.6}; 929 // Prints "(+01.20, +03.40, +05.60)". 930 fmt::print("({:+06.2f})", fmt::join(v.begin(), v.end(), ", ")); 931 932 Thanks `@olivier80 <https://github.com/olivier80>`_. 933 934* Added support for custom formatting specifications to simplify customization 935 of built-in formatting (`#444 <https://github.com/fmtlib/fmt/pull/444>`_). 936 Thanks `@polyvertex (Jean-Charles Lefebvre) <https://github.com/polyvertex>`_. 937 See also `#439 <https://github.com/fmtlib/fmt/issues/439>`_. 938 939* Added ``fmt::format_system_error()`` for error code formatting 940 (`#323 <https://github.com/fmtlib/fmt/issues/323>`_ and 941 `#526 <https://github.com/fmtlib/fmt/pull/526>`_). 942 Thanks `@maddinat0r (Alex Martin) <https://github.com/maddinat0r>`_. 943 944* Added thread-safe ``fmt::localtime()`` and ``fmt::gmtime()`` 945 as replacement for the standard version to ``time.h`` 946 (`#396 <https://github.com/fmtlib/fmt/pull/396>`_). 947 Thanks `@codicodi <https://github.com/codicodi>`_. 948 949* Internal improvements to ``NamedArg`` and ``ArgLists`` 950 (`#389 <https://github.com/fmtlib/fmt/pull/389>`_ and 951 `#390 <https://github.com/fmtlib/fmt/pull/390>`_). 952 Thanks `@chronoxor <https://github.com/chronoxor>`_. 953 954* Fixed crash due to bug in ``FormatBuf`` 955 (`#493 <https://github.com/fmtlib/fmt/pull/493>`_). 956 Thanks `@effzeh <https://github.com/effzeh>`_. See also 957 `#480 <https://github.com/fmtlib/fmt/issues/480>`_ and 958 `#491 <https://github.com/fmtlib/fmt/issues/491>`_. 959 960* Fixed handling of wide strings in ``fmt::StringWriter``. 961 962* Improved compiler error messages 963 (`#357 <https://github.com/fmtlib/fmt/issues/357>`_). 964 965* Fixed various warnings and issues with various compilers 966 (`#494 <https://github.com/fmtlib/fmt/pull/494>`_, 967 `#499 <https://github.com/fmtlib/fmt/pull/499>`_, 968 `#483 <https://github.com/fmtlib/fmt/pull/483>`_, 969 `#485 <https://github.com/fmtlib/fmt/pull/485>`_, 970 `#482 <https://github.com/fmtlib/fmt/pull/482>`_, 971 `#475 <https://github.com/fmtlib/fmt/pull/475>`_, 972 `#473 <https://github.com/fmtlib/fmt/pull/473>`_ and 973 `#414 <https://github.com/fmtlib/fmt/pull/414>`_). 974 Thanks `@chronoxor <https://github.com/chronoxor>`_, 975 `@zhaohuaxishi <https://github.com/zhaohuaxishi>`_, 976 `@pkestene (Pierre Kestener) <https://github.com/pkestene>`_, 977 `@dschmidt (Dominik Schmidt) <https://github.com/dschmidt>`_ and 978 `@0x414c (Alexey Gorishny) <https://github.com/0x414c>`_ . 979 980* Improved CMake: targets are now namespaced 981 (`#511 <https://github.com/fmtlib/fmt/pull/511>`_ and 982 `#513 <https://github.com/fmtlib/fmt/pull/513>`_), supported header-only 983 ``printf.h`` (`#354 <https://github.com/fmtlib/fmt/pull/354>`_), fixed issue 984 with minimal supported library subset 985 (`#418 <https://github.com/fmtlib/fmt/issues/418>`_, 986 `#419 <https://github.com/fmtlib/fmt/pull/419>`_ and 987 `#420 <https://github.com/fmtlib/fmt/pull/420>`_). 988 Thanks `@bjoernthiel (Bjoern Thiel) <https://github.com/bjoernthiel>`_, 989 `@niosHD (Mario Werner) <https://github.com/niosHD>`_, 990 `@LogicalKnight (Sean LK) <https://github.com/LogicalKnight>`_ and 991 `@alabuzhev (Alex Alabuzhev) <https://github.com/alabuzhev>`_. 992 993* Improved documentation. Thanks to 994 `@pwm1234 (Phil) <https://github.com/pwm1234>`_ for 995 `#393 <https://github.com/fmtlib/fmt/pull/393>`_. 996 9973.0.2 - 2017-06-14 998------------------ 999 1000* Added ``FMT_VERSION`` macro 1001 (`#411 <https://github.com/fmtlib/fmt/issues/411>`_). 1002 1003* Used ``FMT_NULL`` instead of literal ``0`` 1004 (`#409 <https://github.com/fmtlib/fmt/pull/409>`_). 1005 Thanks `@alabuzhev (Alex Alabuzhev) <https://github.com/alabuzhev>`_. 1006 1007* Added extern templates for ``format_float`` 1008 (`#413 <https://github.com/fmtlib/fmt/issues/413>`_). 1009 1010* Fixed implicit conversion issue 1011 (`#507 <https://github.com/fmtlib/fmt/issues/507>`_). 1012 1013* Fixed signbit detection (`#423 <https://github.com/fmtlib/fmt/issues/423>`_). 1014 1015* Fixed naming collision (`#425 <https://github.com/fmtlib/fmt/issues/425>`_). 1016 1017* Fixed missing intrinsic for C++/CLI 1018 (`#457 <https://github.com/fmtlib/fmt/pull/457>`_). 1019 Thanks `@calumr (Calum Robinson) <https://github.com/calumr>`_ 1020 1021* Fixed Android detection (`#458 <https://github.com/fmtlib/fmt/pull/458>`_). 1022 Thanks `@Gachapen (Magnus Bjerke Vik) <https://github.com/Gachapen>`_. 1023 1024* Use lean ``windows.h`` if not in header-only mode 1025 (`#503 <https://github.com/fmtlib/fmt/pull/503>`_). 1026 Thanks `@Quentin01 (Quentin Buathier) <https://github.com/Quentin01>`_. 1027 1028* Fixed issue with CMake exporting C++11 flag 1029 (`#445 <https://github.com/fmtlib/fmt/pull/455>`_). 1030 Thanks `@EricWF (Eric) <https://github.com/EricWF>`_. 1031 1032* Fixed issue with nvcc and MSVC compiler bug and MinGW 1033 (`#505 <https://github.com/fmtlib/fmt/issues/505>`_). 1034 1035* Fixed DLL issues (`#469 <https://github.com/fmtlib/fmt/pull/469>`_ and 1036 `#502 <https://github.com/fmtlib/fmt/pull/502>`_). 1037 Thanks `@richardeakin (Richard Eakin) <https://github.com/richardeakin>`_ and 1038 `@AndreasSchoenle (Andreas Schönle) <https://github.com/AndreasSchoenle>`_. 1039 1040* Fixed test compilation under FreeBSD 1041 (`#433 <https://github.com/fmtlib/fmt/issues/433>`_). 1042 1043* Fixed various warnings (`#403 <https://github.com/fmtlib/fmt/pull/403>`_, 1044 `#410 <https://github.com/fmtlib/fmt/pull/410>`_ and 1045 `#510 <https://github.com/fmtlib/fmt/pull/510>`_). 1046 Thanks `@Lecetem <https://github.com/Lectem>`_, 1047 `@chenhayat (Chen Hayat) <https://github.com/chenhayat>`_ and 1048 `@trozen <https://github.com/trozen>`_. 1049 1050* Worked around a broken ``__builtin_clz`` in clang with MS codegen 1051 (`#519 <https://github.com/fmtlib/fmt/issues/519>`_). 1052 1053* Removed redundant include 1054 (`#479 <https://github.com/fmtlib/fmt/issues/479>`_). 1055 1056* Fixed documentation issues. 1057 10583.0.1 - 2016-11-01 1059------------------ 1060* Fixed handling of thousands seperator 1061 (`#353 <https://github.com/fmtlib/fmt/issues/353>`_). 1062 1063* Fixed handling of ``unsigned char`` strings 1064 (`#373 <https://github.com/fmtlib/fmt/issues/373>`_). 1065 1066* Corrected buffer growth when formatting time 1067 (`#367 <https://github.com/fmtlib/fmt/issues/367>`_). 1068 1069* Removed warnings under MSVC and clang 1070 (`#318 <https://github.com/fmtlib/fmt/issues/318>`_, 1071 `#250 <https://github.com/fmtlib/fmt/issues/250>`_, also merged 1072 `#385 <https://github.com/fmtlib/fmt/pull/385>`_ and 1073 `#361 <https://github.com/fmtlib/fmt/pull/361>`_). 1074 Thanks `@jcelerier (Jean-Michaël Celerier) <https://github.com/jcelerier>`_ 1075 and `@nmoehrle (Nils Moehrle) <https://github.com/nmoehrle>`_. 1076 1077* Fixed compilation issues under Android 1078 (`#327 <https://github.com/fmtlib/fmt/pull/327>`_, 1079 `#345 <https://github.com/fmtlib/fmt/issues/345>`_ and 1080 `#381 <https://github.com/fmtlib/fmt/pull/381>`_), 1081 FreeBSD (`#358 <https://github.com/fmtlib/fmt/pull/358>`_), 1082 Cygwin (`#388 <https://github.com/fmtlib/fmt/issues/388>`_), 1083 MinGW (`#355 <https://github.com/fmtlib/fmt/issues/355>`_) as well as other 1084 issues (`#350 <https://github.com/fmtlib/fmt/issues/350>`_, 1085 `#366 <https://github.com/fmtlib/fmt/issues/355>`_, 1086 `#348 <https://github.com/fmtlib/fmt/pull/348>`_, 1087 `#402 <https://github.com/fmtlib/fmt/pull/402>`_, 1088 `#405 <https://github.com/fmtlib/fmt/pull/405>`_). 1089 Thanks to `@dpantele (Dmitry) <https://github.com/dpantele>`_, 1090 `@hghwng (Hugh Wang) <https://github.com/hghwng>`_, 1091 `@arvedarved (Tilman Keskinöz) <https://github.com/arvedarved>`_, 1092 `@LogicalKnight (Sean) <https://github.com/LogicalKnight>`_ and 1093 `@JanHellwig (Jan Hellwig) <https://github.com/janhellwig>`_. 1094 1095* Fixed some documentation issues and extended specification 1096 (`#320 <https://github.com/fmtlib/fmt/issues/320>`_, 1097 `#333 <https://github.com/fmtlib/fmt/pull/333>`_, 1098 `#347 <https://github.com/fmtlib/fmt/issues/347>`_, 1099 `#362 <https://github.com/fmtlib/fmt/pull/362>`_). 1100 Thanks to `@smellman (Taro Matsuzawa aka. btm) 1101 <https://github.com/smellman>`_. 1102 11033.0.0 - 2016-05-07 1104------------------ 1105 1106* The project has been renamed from C++ Format (cppformat) to fmt for 1107 consistency with the used namespace and macro prefix 1108 (`#307 <https://github.com/fmtlib/fmt/issues/307>`_). 1109 Library headers are now located in the ``fmt`` directory: 1110 1111 .. code:: c++ 1112 1113 #include "fmt/format.h" 1114 1115 Including ``format.h`` from the ``cppformat`` directory is deprecated 1116 but works via a proxy header which will be removed in the next major version. 1117 1118 The documentation is now available at http://fmtlib.net. 1119 1120* Added support for `strftime <http://en.cppreference.com/w/cpp/chrono/c/strftime>`_-like 1121 `date and time formatting <http://fmtlib.net/3.0.0/api.html#date-and-time-formatting>`_ 1122 (`#283 <https://github.com/fmtlib/fmt/issues/283>`_): 1123 1124 .. code:: c++ 1125 1126 #include "fmt/time.h" 1127 1128 std::time_t t = std::time(nullptr); 1129 // Prints "The date is 2016-04-29." (with the current date) 1130 fmt::print("The date is {:%Y-%m-%d}.", *std::localtime(&t)); 1131 1132* ``std::ostream`` support including formatting of user-defined types that provide 1133 overloaded ``operator<<`` has been moved to ``fmt/ostream.h``: 1134 1135 .. code:: c++ 1136 1137 #include "fmt/ostream.h" 1138 1139 class Date { 1140 int year_, month_, day_; 1141 public: 1142 Date(int year, int month, int day) : year_(year), month_(month), day_(day) {} 1143 1144 friend std::ostream &operator<<(std::ostream &os, const Date &d) { 1145 return os << d.year_ << '-' << d.month_ << '-' << d.day_; 1146 } 1147 }; 1148 1149 std::string s = fmt::format("The date is {}", Date(2012, 12, 9)); 1150 // s == "The date is 2012-12-9" 1151 1152* Added support for `custom argument formatters 1153 <http://fmtlib.net/3.0.0/api.html#argument-formatters>`_ 1154 (`#235 <https://github.com/fmtlib/fmt/issues/235>`_). 1155 1156* Added support for locale-specific integer formatting with the ``n`` specifier 1157 (`#305 <https://github.com/fmtlib/fmt/issues/305>`_): 1158 1159 .. code:: c++ 1160 1161 std::setlocale(LC_ALL, "en_US.utf8"); 1162 fmt::print("cppformat: {:n}\n", 1234567); // prints 1,234,567 1163 1164* Sign is now preserved when formatting an integer with an incorrect ``printf`` 1165 format specifier (`#265 <https://github.com/fmtlib/fmt/issues/265>`_): 1166 1167 .. code:: c++ 1168 1169 fmt::printf("%lld", -42); // prints -42 1170 1171 Note that it would be an undefined behavior in ``std::printf``. 1172 1173* Length modifiers such as ``ll`` are now optional in printf formatting 1174 functions and the correct type is determined automatically 1175 (`#255 <https://github.com/fmtlib/fmt/issues/255>`_): 1176 1177 .. code:: c++ 1178 1179 fmt::printf("%d", std::numeric_limits<long long>::max()); 1180 1181 Note that it would be an undefined behavior in ``std::printf``. 1182 1183* Added initial support for custom formatters 1184 (`#231 <https://github.com/fmtlib/fmt/issues/231>`_). 1185 1186* Fixed detection of user-defined literal support on Intel C++ compiler 1187 (`#311 <https://github.com/fmtlib/fmt/issues/311>`_, 1188 `#312 <https://github.com/fmtlib/fmt/pull/312>`_). 1189 Thanks to `@dean0x7d (Dean Moldovan) <https://github.com/dean0x7d>`_ and 1190 `@speth (Ray Speth) <https://github.com/speth>`_. 1191 1192* Reduced compile time 1193 (`#243 <https://github.com/fmtlib/fmt/pull/243>`_, 1194 `#249 <https://github.com/fmtlib/fmt/pull/249>`_, 1195 `#317 <https://github.com/fmtlib/fmt/issues/317>`_): 1196 1197 .. image:: https://cloud.githubusercontent.com/assets/4831417/11614060/ 1198 b9e826d2-9c36-11e5-8666-d4131bf503ef.png 1199 1200 .. image:: https://cloud.githubusercontent.com/assets/4831417/11614080/ 1201 6ac903cc-9c37-11e5-8165-26df6efae364.png 1202 1203 Thanks to `@dean0x7d (Dean Moldovan) <https://github.com/dean0x7d>`_. 1204 1205* Compile test fixes (`#313 <https://github.com/fmtlib/fmt/pull/313>`_). 1206 Thanks to `@dean0x7d (Dean Moldovan) <https://github.com/dean0x7d>`_. 1207 1208* Documentation fixes (`#239 <https://github.com/fmtlib/fmt/pull/239>`_, 1209 `#248 <https://github.com/fmtlib/fmt/issues/248>`_, 1210 `#252 <https://github.com/fmtlib/fmt/issues/252>`_, 1211 `#258 <https://github.com/fmtlib/fmt/pull/258>`_, 1212 `#260 <https://github.com/fmtlib/fmt/issues/260>`_, 1213 `#301 <https://github.com/fmtlib/fmt/issues/301>`_, 1214 `#309 <https://github.com/fmtlib/fmt/pull/309>`_). 1215 Thanks to `@ReadmeCritic <https://github.com/ReadmeCritic>`_ 1216 `@Gachapen (Magnus Bjerke Vik) <https://github.com/Gachapen>`_ and 1217 `@jwilk (Jakub Wilk) <https://github.com/jwilk>`_. 1218 1219* Fixed compiler and sanitizer warnings 1220 (`#244 <https://github.com/fmtlib/fmt/issues/244>`_, 1221 `#256 <https://github.com/fmtlib/fmt/pull/256>`_, 1222 `#259 <https://github.com/fmtlib/fmt/pull/259>`_, 1223 `#263 <https://github.com/fmtlib/fmt/issues/263>`_, 1224 `#274 <https://github.com/fmtlib/fmt/issues/274>`_, 1225 `#277 <https://github.com/fmtlib/fmt/pull/277>`_, 1226 `#286 <https://github.com/fmtlib/fmt/pull/286>`_, 1227 `#291 <https://github.com/fmtlib/fmt/issues/291>`_, 1228 `#296 <https://github.com/fmtlib/fmt/issues/296>`_, 1229 `#308 <https://github.com/fmtlib/fmt/issues/308>`_) 1230 Thanks to `@mwinterb <https://github.com/mwinterb>`_, 1231 `@pweiskircher (Patrik Weiskircher) <https://github.com/pweiskircher>`_, 1232 `@Naios <https://github.com/Naios>`_. 1233 1234* Improved compatibility with Windows Store apps 1235 (`#280 <https://github.com/fmtlib/fmt/issues/280>`_, 1236 `#285 <https://github.com/fmtlib/fmt/pull/285>`_) 1237 Thanks to `@mwinterb <https://github.com/mwinterb>`_. 1238 1239* Added tests of compatibility with older C++ standards 1240 (`#273 <https://github.com/fmtlib/fmt/pull/273>`_). 1241 Thanks to `@niosHD <https://github.com/niosHD>`_. 1242 1243* Fixed Android build (`#271 <https://github.com/fmtlib/fmt/pull/271>`_). 1244 Thanks to `@newnon <https://github.com/newnon>`_. 1245 1246* Changed ``ArgMap`` to be backed by a vector instead of a map. 1247 (`#261 <https://github.com/fmtlib/fmt/issues/261>`_, 1248 `#262 <https://github.com/fmtlib/fmt/pull/262>`_). 1249 Thanks to `@mwinterb <https://github.com/mwinterb>`_. 1250 1251* Added ``fprintf`` overload that writes to a ``std::ostream`` 1252 (`#251 <https://github.com/fmtlib/fmt/pull/251>`_). 1253 Thanks to `nickhutchinson (Nicholas Hutchinson) <https://github.com/nickhutchinson>`_. 1254 1255* Export symbols when building a Windows DLL 1256 (`#245 <https://github.com/fmtlib/fmt/pull/245>`_). 1257 Thanks to `macdems (Maciek Dems) <https://github.com/macdems>`_. 1258 1259* Fixed compilation on Cygwin (`#304 <https://github.com/fmtlib/fmt/issues/304>`_). 1260 1261* Implemented a workaround for a bug in Apple LLVM version 4.2 of clang 1262 (`#276 <https://github.com/fmtlib/fmt/issues/276>`_). 1263 1264* Implemented a workaround for Google Test bug 1265 `#705 <https://github.com/google/googletest/issues/705>`_ on gcc 6 1266 (`#268 <https://github.com/fmtlib/fmt/issues/268>`_). 1267 Thanks to `octoploid <https://github.com/octoploid>`_. 1268 1269* Removed Biicode support because the latter has been discontinued. 1270 12712.1.1 - 2016-04-11 1272------------------ 1273 1274* The install location for generated CMake files is now configurable via 1275 the ``FMT_CMAKE_DIR`` CMake variable 1276 (`#299 <https://github.com/fmtlib/fmt/pull/299>`_). 1277 Thanks to `@niosHD <https://github.com/niosHD>`_. 1278 1279* Documentation fixes (`#252 <https://github.com/fmtlib/fmt/issues/252>`_). 1280 12812.1.0 - 2016-03-21 1282------------------ 1283 1284* Project layout and build system improvements 1285 (`#267 <https://github.com/fmtlib/fmt/pull/267>`_): 1286 1287 * The code have been moved to the ``cppformat`` directory. 1288 Including ``format.h`` from the top-level directory is deprecated 1289 but works via a proxy header which will be removed in the next 1290 major version. 1291 1292 * C++ Format CMake targets now have proper interface definitions. 1293 1294 * Installed version of the library now supports the header-only 1295 configuration. 1296 1297 * Targets ``doc``, ``install``, and ``test`` are now disabled if C++ Format 1298 is included as a CMake subproject. They can be enabled by setting 1299 ``FMT_DOC``, ``FMT_INSTALL``, and ``FMT_TEST`` in the parent project. 1300 1301 Thanks to `@niosHD <https://github.com/niosHD>`_. 1302 13032.0.1 - 2016-03-13 1304------------------ 1305 1306* Improved CMake find and package support 1307 (`#264 <https://github.com/fmtlib/fmt/issues/264>`_). 1308 Thanks to `@niosHD <https://github.com/niosHD>`_. 1309 1310* Fix compile error with Android NDK and mingw32 1311 (`#241 <https://github.com/fmtlib/fmt/issues/241>`_). 1312 Thanks to `@Gachapen (Magnus Bjerke Vik) <https://github.com/Gachapen>`_. 1313 1314* Documentation fixes 1315 (`#248 <https://github.com/fmtlib/fmt/issues/248>`_, 1316 `#260 <https://github.com/fmtlib/fmt/issues/260>`_). 1317 13182.0.0 - 2015-12-01 1319------------------ 1320 1321General 1322~~~~~~~ 1323 1324* [Breaking] Named arguments 1325 (`#169 <https://github.com/fmtlib/fmt/pull/169>`_, 1326 `#173 <https://github.com/fmtlib/fmt/pull/173>`_, 1327 `#174 <https://github.com/fmtlib/fmt/pull/174>`_): 1328 1329 .. code:: c++ 1330 1331 fmt::print("The answer is {answer}.", fmt::arg("answer", 42)); 1332 1333 Thanks to `@jamboree <https://github.com/jamboree>`_. 1334 1335* [Experimental] User-defined literals for format and named arguments 1336 (`#204 <https://github.com/fmtlib/fmt/pull/204>`_, 1337 `#206 <https://github.com/fmtlib/fmt/pull/206>`_, 1338 `#207 <https://github.com/fmtlib/fmt/pull/207>`_): 1339 1340 .. code:: c++ 1341 1342 using namespace fmt::literals; 1343 fmt::print("The answer is {answer}.", "answer"_a=42); 1344 1345 Thanks to `@dean0x7d (Dean Moldovan) <https://github.com/dean0x7d>`_. 1346 1347* [Breaking] Formatting of more than 16 arguments is now supported when using 1348 variadic templates 1349 (`#141 <https://github.com/fmtlib/fmt/issues/141>`_). 1350 Thanks to `@Shauren <https://github.com/Shauren>`_. 1351 1352* Runtime width specification 1353 (`#168 <https://github.com/fmtlib/fmt/pull/168>`_): 1354 1355 .. code:: c++ 1356 1357 fmt::format("{0:{1}}", 42, 5); // gives " 42" 1358 1359 Thanks to `@jamboree <https://github.com/jamboree>`_. 1360 1361* [Breaking] Enums are now formatted with an overloaded ``std::ostream`` insertion 1362 operator (``operator<<``) if available 1363 (`#232 <https://github.com/fmtlib/fmt/issues/232>`_). 1364 1365* [Breaking] Changed default ``bool`` format to textual, "true" or "false" 1366 (`#170 <https://github.com/fmtlib/fmt/issues/170>`_): 1367 1368 .. code:: c++ 1369 1370 fmt::print("{}", true); // prints "true" 1371 1372 To print ``bool`` as a number use numeric format specifier such as ``d``: 1373 1374 .. code:: c++ 1375 1376 fmt::print("{:d}", true); // prints "1" 1377 1378* ``fmt::printf`` and ``fmt::sprintf`` now support formatting of ``bool`` with the 1379 ``%s`` specifier giving textual output, "true" or "false" 1380 (`#223 <https://github.com/fmtlib/fmt/pull/223>`_): 1381 1382 .. code:: c++ 1383 1384 fmt::printf("%s", true); // prints "true" 1385 1386 Thanks to `@LarsGullik <https://github.com/LarsGullik>`_. 1387 1388* [Breaking] ``signed char`` and ``unsigned char`` are now formatted as integers by default 1389 (`#217 <https://github.com/fmtlib/fmt/pull/217>`_). 1390 1391* [Breaking] Pointers to C strings can now be formatted with the ``p`` specifier 1392 (`#223 <https://github.com/fmtlib/fmt/pull/223>`_): 1393 1394 .. code:: c++ 1395 1396 fmt::print("{:p}", "test"); // prints pointer value 1397 1398 Thanks to `@LarsGullik <https://github.com/LarsGullik>`_. 1399 1400* [Breaking] ``fmt::printf`` and ``fmt::sprintf`` now print null pointers as ``(nil)`` 1401 and null strings as ``(null)`` for consistency with glibc 1402 (`#226 <https://github.com/fmtlib/fmt/pull/226>`_). 1403 Thanks to `@LarsGullik <https://github.com/LarsGullik>`_. 1404 1405* [Breaking] ``fmt::(s)printf`` now supports formatting of objects of user-defined types 1406 that provide an overloaded ``std::ostream`` insertion operator (``operator<<``) 1407 (`#201 <https://github.com/fmtlib/fmt/issues/201>`_): 1408 1409 .. code:: c++ 1410 1411 fmt::printf("The date is %s", Date(2012, 12, 9)); 1412 1413* [Breaking] The ``Buffer`` template is now part of the public API and can be used 1414 to implement custom memory buffers 1415 (`#140 <https://github.com/fmtlib/fmt/issues/140>`_). 1416 Thanks to `@polyvertex (Jean-Charles Lefebvre) <https://github.com/polyvertex>`_. 1417 1418* [Breaking] Improved compatibility between ``BasicStringRef`` and 1419 `std::experimental::basic_string_view 1420 <http://en.cppreference.com/w/cpp/experimental/basic_string_view>`_ 1421 (`#100 <https://github.com/fmtlib/fmt/issues/100>`_, 1422 `#159 <https://github.com/fmtlib/fmt/issues/159>`_, 1423 `#183 <https://github.com/fmtlib/fmt/issues/183>`_): 1424 1425 - Comparison operators now compare string content, not pointers 1426 - ``BasicStringRef::c_str`` replaced by ``BasicStringRef::data`` 1427 - ``BasicStringRef`` is no longer assumed to be null-terminated 1428 1429 References to null-terminated strings are now represented by a new class, 1430 ``BasicCStringRef``. 1431 1432* Dependency on pthreads introduced by Google Test is now optional 1433 (`#185 <https://github.com/fmtlib/fmt/issues/185>`_). 1434 1435* New CMake options ``FMT_DOC``, ``FMT_INSTALL`` and ``FMT_TEST`` to control 1436 generation of ``doc``, ``install`` and ``test`` targets respectively, on by default 1437 (`#197 <https://github.com/fmtlib/fmt/issues/197>`_, 1438 `#198 <https://github.com/fmtlib/fmt/issues/198>`_, 1439 `#200 <https://github.com/fmtlib/fmt/issues/200>`_). 1440 Thanks to `@maddinat0r (Alex Martin) <https://github.com/maddinat0r>`_. 1441 1442* ``noexcept`` is now used when compiling with MSVC2015 1443 (`#215 <https://github.com/fmtlib/fmt/pull/215>`_). 1444 Thanks to `@dmkrepo (Dmitriy) <https://github.com/dmkrepo>`_. 1445 1446* Added an option to disable use of ``windows.h`` when ``FMT_USE_WINDOWS_H`` 1447 is defined as 0 before including ``format.h`` 1448 (`#171 <https://github.com/fmtlib/fmt/issues/171>`_). 1449 Thanks to `@alfps (Alf P. Steinbach) <https://github.com/alfps>`_. 1450 1451* [Breaking] ``windows.h`` is now included with ``NOMINMAX`` unless 1452 ``FMT_WIN_MINMAX`` is defined. This is done to prevent breaking code using 1453 ``std::min`` and ``std::max`` and only affects the header-only configuration 1454 (`#152 <https://github.com/fmtlib/fmt/issues/152>`_, 1455 `#153 <https://github.com/fmtlib/fmt/pull/153>`_, 1456 `#154 <https://github.com/fmtlib/fmt/pull/154>`_). 1457 Thanks to `@DevO2012 <https://github.com/DevO2012>`_. 1458 1459* Improved support for custom character types 1460 (`#171 <https://github.com/fmtlib/fmt/issues/171>`_). 1461 Thanks to `@alfps (Alf P. Steinbach) <https://github.com/alfps>`_. 1462 1463* Added an option to disable use of IOStreams when ``FMT_USE_IOSTREAMS`` 1464 is defined as 0 before including ``format.h`` 1465 (`#205 <https://github.com/fmtlib/fmt/issues/205>`_, 1466 `#208 <https://github.com/fmtlib/fmt/pull/208>`_). 1467 Thanks to `@JodiTheTigger <https://github.com/JodiTheTigger>`_. 1468 1469* Improved detection of ``isnan``, ``isinf`` and ``signbit``. 1470 1471Optimization 1472~~~~~~~~~~~~ 1473 1474* Made formatting of user-defined types more efficient with a custom stream buffer 1475 (`#92 <https://github.com/fmtlib/fmt/issues/92>`_, 1476 `#230 <https://github.com/fmtlib/fmt/pull/230>`_). 1477 Thanks to `@NotImplemented <https://github.com/NotImplemented>`_. 1478 1479* Further improved performance of ``fmt::Writer`` on integer formatting 1480 and fixed a minor regression. Now it is ~7% faster than ``karma::generate`` 1481 on Karma's benchmark 1482 (`#186 <https://github.com/fmtlib/fmt/issues/186>`_). 1483 1484* [Breaking] Reduced `compiled code size 1485 <https://github.com/fmtlib/fmt#compile-time-and-code-bloat>`_ 1486 (`#143 <https://github.com/fmtlib/fmt/issues/143>`_, 1487 `#149 <https://github.com/fmtlib/fmt/pull/149>`_). 1488 1489Distribution 1490~~~~~~~~~~~~ 1491 1492* [Breaking] Headers are now installed in 1493 ``${CMAKE_INSTALL_PREFIX}/include/cppformat`` 1494 (`#178 <https://github.com/fmtlib/fmt/issues/178>`_). 1495 Thanks to `@jackyf (Eugene V. Lyubimkin) <https://github.com/jackyf>`_. 1496 1497* [Breaking] Changed the library name from ``format`` to ``cppformat`` 1498 for consistency with the project name and to avoid potential conflicts 1499 (`#178 <https://github.com/fmtlib/fmt/issues/178>`_). 1500 Thanks to `@jackyf (Eugene V. Lyubimkin) <https://github.com/jackyf>`_. 1501 1502* C++ Format is now available in `Debian <https://www.debian.org/>`_ GNU/Linux 1503 (`stretch <https://packages.debian.org/source/stretch/cppformat>`_, 1504 `sid <https://packages.debian.org/source/sid/cppformat>`_) and 1505 derived distributions such as 1506 `Ubuntu <https://launchpad.net/ubuntu/+source/cppformat>`_ 15.10 and later 1507 (`#155 <https://github.com/fmtlib/fmt/issues/155>`_):: 1508 1509 $ sudo apt-get install libcppformat1-dev 1510 1511 Thanks to `@jackyf (Eugene V. Lyubimkin) <https://github.com/jackyf>`_. 1512 1513* `Packages for Fedora and RHEL <https://admin.fedoraproject.org/pkgdb/package/cppformat/>`_ 1514 are now available. Thanks to Dave Johansen. 1515 1516* C++ Format can now be installed via `Homebrew <http://brew.sh/>`_ on OS X 1517 (`#157 <https://github.com/fmtlib/fmt/issues/157>`_):: 1518 1519 $ brew install cppformat 1520 1521 Thanks to `@ortho <https://github.com/ortho>`_, Anatoliy Bulukin. 1522 1523Documentation 1524~~~~~~~~~~~~~ 1525 1526* Migrated from ReadTheDocs to GitHub Pages for better responsiveness 1527 and reliability 1528 (`#128 <https://github.com/fmtlib/fmt/issues/128>`_). 1529 New documentation address is http://cppformat.github.io/. 1530 1531 1532* Added `Building the documentation 1533 <http://fmtlib.net/2.0.0/usage.html#building-the-documentation>`_ 1534 section to the documentation. 1535 1536* Documentation build script is now compatible with Python 3 and newer pip versions. 1537 (`#189 <https://github.com/fmtlib/fmt/pull/189>`_, 1538 `#209 <https://github.com/fmtlib/fmt/issues/209>`_). 1539 Thanks to `@JodiTheTigger <https://github.com/JodiTheTigger>`_ and 1540 `@xentec <https://github.com/xentec>`_. 1541 1542* Documentation fixes and improvements 1543 (`#36 <https://github.com/fmtlib/fmt/issues/36>`_, 1544 `#75 <https://github.com/fmtlib/fmt/issues/75>`_, 1545 `#125 <https://github.com/fmtlib/fmt/issues/125>`_, 1546 `#160 <https://github.com/fmtlib/fmt/pull/160>`_, 1547 `#161 <https://github.com/fmtlib/fmt/pull/161>`_, 1548 `#162 <https://github.com/fmtlib/fmt/issues/162>`_, 1549 `#165 <https://github.com/fmtlib/fmt/issues/165>`_, 1550 `#210 <https://github.com/fmtlib/fmt/issues/210>`_). 1551 Thanks to `@syohex (Syohei YOSHIDA) <https://github.com/syohex>`_ and 1552 bug reporters. 1553 1554* Fixed out-of-tree documentation build 1555 (`#177 <https://github.com/fmtlib/fmt/issues/177>`_). 1556 Thanks to `@jackyf (Eugene V. Lyubimkin) <https://github.com/jackyf>`_. 1557 1558Fixes 1559~~~~~ 1560 1561* Fixed ``initializer_list`` detection 1562 (`#136 <https://github.com/fmtlib/fmt/issues/136>`_). 1563 Thanks to `@Gachapen (Magnus Bjerke Vik) <https://github.com/Gachapen>`_. 1564 1565* [Breaking] Fixed formatting of enums with numeric format specifiers in 1566 ``fmt::(s)printf`` 1567 (`#131 <https://github.com/fmtlib/fmt/issues/131>`_, 1568 `#139 <https://github.com/fmtlib/fmt/issues/139>`_): 1569 1570 .. code:: c++ 1571 1572 enum { ANSWER = 42 }; 1573 fmt::printf("%d", ANSWER); 1574 1575 Thanks to `@Naios <https://github.com/Naios>`_. 1576 1577* Improved compatibility with old versions of MinGW 1578 (`#129 <https://github.com/fmtlib/fmt/issues/129>`_, 1579 `#130 <https://github.com/fmtlib/fmt/pull/130>`_, 1580 `#132 <https://github.com/fmtlib/fmt/issues/132>`_). 1581 Thanks to `@cstamford (Christopher Stamford) <https://github.com/cstamford>`_. 1582 1583* Fixed a compile error on MSVC with disabled exceptions 1584 (`#144 <https://github.com/fmtlib/fmt/issues/144>`_). 1585 1586* Added a workaround for broken implementation of variadic templates in MSVC2012 1587 (`#148 <https://github.com/fmtlib/fmt/issues/148>`_). 1588 1589* Placed the anonymous namespace within ``fmt`` namespace for the header-only 1590 configuration 1591 (`#171 <https://github.com/fmtlib/fmt/issues/171>`_). 1592 Thanks to `@alfps (Alf P. Steinbach) <https://github.com/alfps>`_. 1593 1594* Fixed issues reported by Coverity Scan 1595 (`#187 <https://github.com/fmtlib/fmt/issues/187>`_, 1596 `#192 <https://github.com/fmtlib/fmt/issues/192>`_). 1597 1598* Implemented a workaround for a name lookup bug in MSVC2010 1599 (`#188 <https://github.com/fmtlib/fmt/issues/188>`_). 1600 1601* Fixed compiler warnings 1602 (`#95 <https://github.com/fmtlib/fmt/issues/95>`_, 1603 `#96 <https://github.com/fmtlib/fmt/issues/96>`_, 1604 `#114 <https://github.com/fmtlib/fmt/pull/114>`_, 1605 `#135 <https://github.com/fmtlib/fmt/issues/135>`_, 1606 `#142 <https://github.com/fmtlib/fmt/issues/142>`_, 1607 `#145 <https://github.com/fmtlib/fmt/issues/145>`_, 1608 `#146 <https://github.com/fmtlib/fmt/issues/146>`_, 1609 `#158 <https://github.com/fmtlib/fmt/issues/158>`_, 1610 `#163 <https://github.com/fmtlib/fmt/issues/163>`_, 1611 `#175 <https://github.com/fmtlib/fmt/issues/175>`_, 1612 `#190 <https://github.com/fmtlib/fmt/issues/190>`_, 1613 `#191 <https://github.com/fmtlib/fmt/pull/191>`_, 1614 `#194 <https://github.com/fmtlib/fmt/issues/194>`_, 1615 `#196 <https://github.com/fmtlib/fmt/pull/196>`_, 1616 `#216 <https://github.com/fmtlib/fmt/issues/216>`_, 1617 `#218 <https://github.com/fmtlib/fmt/pull/218>`_, 1618 `#220 <https://github.com/fmtlib/fmt/pull/220>`_, 1619 `#229 <https://github.com/fmtlib/fmt/pull/229>`_, 1620 `#233 <https://github.com/fmtlib/fmt/issues/233>`_, 1621 `#234 <https://github.com/fmtlib/fmt/issues/234>`_, 1622 `#236 <https://github.com/fmtlib/fmt/pull/236>`_, 1623 `#281 <https://github.com/fmtlib/fmt/issues/281>`_, 1624 `#289 <https://github.com/fmtlib/fmt/issues/289>`_). 1625 Thanks to `@seanmiddleditch (Sean Middleditch) <https://github.com/seanmiddleditch>`_, 1626 `@dixlorenz (Dix Lorenz) <https://github.com/dixlorenz>`_, 1627 `@CarterLi (李通洲) <https://github.com/CarterLi>`_, 1628 `@Naios <https://github.com/Naios>`_, 1629 `@fmatthew5876 (Matthew Fioravante) <https://github.com/fmatthew5876>`_, 1630 `@LevskiWeng (Levski Weng) <https://github.com/LevskiWeng>`_, 1631 `@rpopescu <https://github.com/rpopescu>`_, 1632 `@gabime (Gabi Melman) <https://github.com/gabime>`_, 1633 `@cubicool (Jeremy Moles) <https://github.com/cubicool>`_, 1634 `@jkflying (Julian Kent) <https://github.com/jkflying>`_, 1635 `@LogicalKnight (Sean L) <https://github.com/LogicalKnight>`_, 1636 `@inguin (Ingo van Lil) <https://github.com/inguin>`_ and 1637 `@Jopie64 (Johan) <https://github.com/Jopie64>`_. 1638 1639* Fixed portability issues (mostly causing test failures) on ARM, ppc64, ppc64le, 1640 s390x and SunOS 5.11 i386 1641 (`#138 <https://github.com/fmtlib/fmt/issues/138>`_, 1642 `#179 <https://github.com/fmtlib/fmt/issues/179>`_, 1643 `#180 <https://github.com/fmtlib/fmt/issues/180>`_, 1644 `#202 <https://github.com/fmtlib/fmt/issues/202>`_, 1645 `#225 <https://github.com/fmtlib/fmt/issues/225>`_, 1646 `Red Hat Bugzilla Bug 1260297 <https://bugzilla.redhat.com/show_bug.cgi?id=1260297>`_). 1647 Thanks to `@Naios <https://github.com/Naios>`_, 1648 `@jackyf (Eugene V. Lyubimkin) <https://github.com/jackyf>`_ and Dave Johansen. 1649 1650* Fixed a name conflict with macro ``free`` defined in 1651 ``crtdbg.h`` when ``_CRTDBG_MAP_ALLOC`` is set 1652 (`#211 <https://github.com/fmtlib/fmt/issues/211>`_). 1653 1654* Fixed shared library build on OS X 1655 (`#212 <https://github.com/fmtlib/fmt/pull/212>`_). 1656 Thanks to `@dean0x7d (Dean Moldovan) <https://github.com/dean0x7d>`_. 1657 1658* Fixed an overload conflict on MSVC when ``/Zc:wchar_t-`` option is specified 1659 (`#214 <https://github.com/fmtlib/fmt/pull/214>`_). 1660 Thanks to `@slavanap (Vyacheslav Napadovsky) <https://github.com/slavanap>`_. 1661 1662* Improved compatibility with MSVC 2008 1663 (`#236 <https://github.com/fmtlib/fmt/pull/236>`_). 1664 Thanks to `@Jopie64 (Johan) <https://github.com/Jopie64>`_. 1665 1666* Improved compatibility with bcc32 1667 (`#227 <https://github.com/fmtlib/fmt/issues/227>`_). 1668 1669* Fixed ``static_assert`` detection on Clang 1670 (`#228 <https://github.com/fmtlib/fmt/pull/228>`_). 1671 Thanks to `@dean0x7d (Dean Moldovan) <https://github.com/dean0x7d>`_. 1672 16731.1.0 - 2015-03-06 1674------------------ 1675 1676* Added ``BasicArrayWriter``, a class template that provides operations for 1677 formatting and writing data into a fixed-size array 1678 (`#105 <https://github.com/fmtlib/fmt/issues/105>`_ and 1679 `#122 <https://github.com/fmtlib/fmt/issues/122>`_): 1680 1681 .. code:: c++ 1682 1683 char buffer[100]; 1684 fmt::ArrayWriter w(buffer); 1685 w.write("The answer is {}", 42); 1686 1687* Added `0 A.D. <http://play0ad.com/>`_ and `PenUltima Online (POL) 1688 <http://www.polserver.com/>`_ to the list of notable projects using C++ Format. 1689 1690* C++ Format now uses MSVC intrinsics for better formatting performance 1691 (`#115 <https://github.com/fmtlib/fmt/pull/115>`_, 1692 `#116 <https://github.com/fmtlib/fmt/pull/116>`_, 1693 `#118 <https://github.com/fmtlib/fmt/pull/118>`_ and 1694 `#121 <https://github.com/fmtlib/fmt/pull/121>`_). 1695 Previously these optimizations where only used on GCC and Clang. 1696 Thanks to `@CarterLi <https://github.com/CarterLi>`_ and 1697 `@objectx <https://github.com/objectx>`_. 1698 1699* CMake install target (`#119 <https://github.com/fmtlib/fmt/pull/119>`_). 1700 Thanks to `@TrentHouliston <https://github.com/TrentHouliston>`_. 1701 1702 You can now install C++ Format with ``make install`` command. 1703 1704* Improved `Biicode <http://www.biicode.com/>`_ support 1705 (`#98 <https://github.com/fmtlib/fmt/pull/98>`_ and 1706 `#104 <https://github.com/fmtlib/fmt/pull/104>`_). Thanks to 1707 `@MariadeAnton <https://github.com/MariadeAnton>`_ and 1708 `@franramirez688 <https://github.com/franramirez688>`_. 1709 1710* Improved support for building with `Android NDK 1711 <https://developer.android.com/tools/sdk/ndk/index.html>`_ 1712 (`#107 <https://github.com/fmtlib/fmt/pull/107>`_). 1713 Thanks to `@newnon <https://github.com/newnon>`_. 1714 1715 The `android-ndk-example <https://github.com/fmtlib/android-ndk-example>`_ 1716 repository provides and example of using C++ Format with Android NDK: 1717 1718 .. image:: https://raw.githubusercontent.com/fmtlib/android-ndk-example/ 1719 master/screenshot.png 1720 1721* Improved documentation of ``SystemError`` and ``WindowsError`` 1722 (`#54 <https://github.com/fmtlib/fmt/issues/54>`_). 1723 1724* Various code improvements 1725 (`#110 <https://github.com/fmtlib/fmt/pull/110>`_, 1726 `#111 <https://github.com/fmtlib/fmt/pull/111>`_ 1727 `#112 <https://github.com/fmtlib/fmt/pull/112>`_). 1728 Thanks to `@CarterLi <https://github.com/CarterLi>`_. 1729 1730* Improved compile-time errors when formatting wide into narrow strings 1731 (`#117 <https://github.com/fmtlib/fmt/issues/117>`_). 1732 1733* Fixed ``BasicWriter::write`` without formatting arguments when C++11 support 1734 is disabled (`#109 <https://github.com/fmtlib/fmt/issues/109>`_). 1735 1736* Fixed header-only build on OS X with GCC 4.9 1737 (`#124 <https://github.com/fmtlib/fmt/issues/124>`_). 1738 1739* Fixed packaging issues (`#94 <https://github.com/fmtlib/fmt/issues/94>`_). 1740 1741* Added `changelog <https://github.com/fmtlib/fmt/blob/master/ChangeLog.rst>`_ 1742 (`#103 <https://github.com/fmtlib/fmt/issues/103>`_). 1743 17441.0.0 - 2015-02-05 1745------------------ 1746 1747* Add support for a header-only configuration when ``FMT_HEADER_ONLY`` is 1748 defined before including ``format.h``: 1749 1750 .. code:: c++ 1751 1752 #define FMT_HEADER_ONLY 1753 #include "format.h" 1754 1755* Compute string length in the constructor of ``BasicStringRef`` 1756 instead of the ``size`` method 1757 (`#79 <https://github.com/fmtlib/fmt/issues/79>`_). 1758 This eliminates size computation for string literals on reasonable optimizing 1759 compilers. 1760 1761* Fix formatting of types with overloaded ``operator <<`` for ``std::wostream`` 1762 (`#86 <https://github.com/fmtlib/fmt/issues/86>`_): 1763 1764 .. code:: c++ 1765 1766 fmt::format(L"The date is {0}", Date(2012, 12, 9)); 1767 1768* Fix linkage of tests on Arch Linux 1769 (`#89 <https://github.com/fmtlib/fmt/issues/89>`_). 1770 1771* Allow precision specifier for non-float arguments 1772 (`#90 <https://github.com/fmtlib/fmt/issues/90>`_): 1773 1774 .. code:: c++ 1775 1776 fmt::print("{:.3}\n", "Carpet"); // prints "Car" 1777 1778* Fix build on Android NDK 1779 (`#93 <https://github.com/fmtlib/fmt/issues/93>`_) 1780 1781* Improvements to documentation build procedure. 1782 1783* Remove ``FMT_SHARED`` CMake variable in favor of standard `BUILD_SHARED_LIBS 1784 <http://www.cmake.org/cmake/help/v3.0/variable/BUILD_SHARED_LIBS.html>`_. 1785 1786* Fix error handling in ``fmt::fprintf``. 1787 1788* Fix a number of warnings. 1789 17900.12.0 - 2014-10-25 1791------------------- 1792 1793* [Breaking] Improved separation between formatting and buffer management. 1794 ``Writer`` is now a base class that cannot be instantiated directly. 1795 The new ``MemoryWriter`` class implements the default buffer management 1796 with small allocations done on stack. So ``fmt::Writer`` should be replaced 1797 with ``fmt::MemoryWriter`` in variable declarations. 1798 1799 Old code: 1800 1801 .. code:: c++ 1802 1803 fmt::Writer w; 1804 1805 New code: 1806 1807 .. code:: c++ 1808 1809 fmt::MemoryWriter w; 1810 1811 If you pass ``fmt::Writer`` by reference, you can continue to do so: 1812 1813 .. code:: c++ 1814 1815 void f(fmt::Writer &w); 1816 1817 This doesn't affect the formatting API. 1818 1819* Support for custom memory allocators 1820 (`#69 <https://github.com/fmtlib/fmt/issues/69>`_) 1821 1822* Formatting functions now accept `signed char` and `unsigned char` strings as 1823 arguments (`#73 <https://github.com/fmtlib/fmt/issues/73>`_): 1824 1825 .. code:: c++ 1826 1827 auto s = format("GLSL version: {}", glGetString(GL_VERSION)); 1828 1829* Reduced code bloat. According to the new `benchmark results 1830 <https://github.com/fmtlib/fmt#compile-time-and-code-bloat>`_, 1831 cppformat is close to ``printf`` and by the order of magnitude better than 1832 Boost Format in terms of compiled code size. 1833 1834* Improved appearance of the documentation on mobile by using the `Sphinx 1835 Bootstrap theme <http://ryan-roemer.github.io/sphinx-bootstrap-theme/>`_: 1836 1837 .. |old| image:: https://cloud.githubusercontent.com/assets/576385/4792130/ 1838 cd256436-5de3-11e4-9a62-c077d0c2b003.png 1839 1840 .. |new| image:: https://cloud.githubusercontent.com/assets/576385/4792131/ 1841 cd29896c-5de3-11e4-8f59-cac952942bf0.png 1842 1843 +-------+-------+ 1844 | Old | New | 1845 +-------+-------+ 1846 | |old| | |new| | 1847 +-------+-------+ 1848 18490.11.0 - 2014-08-21 1850------------------- 1851 1852* Safe printf implementation with a POSIX extension for positional arguments: 1853 1854 .. code:: c++ 1855 1856 fmt::printf("Elapsed time: %.2f seconds", 1.23); 1857 fmt::printf("%1$s, %3$d %2$s", weekday, month, day); 1858 1859* Arguments of ``char`` type can now be formatted as integers 1860 (Issue `#55 <https://github.com/fmtlib/fmt/issues/55>`_): 1861 1862 .. code:: c++ 1863 1864 fmt::format("0x{0:02X}", 'a'); 1865 1866* Deprecated parts of the API removed. 1867 1868* The library is now built and tested on MinGW with Appveyor in addition to 1869 existing test platforms Linux/GCC, OS X/Clang, Windows/MSVC. 1870 18710.10.0 - 2014-07-01 1872------------------- 1873 1874**Improved API** 1875 1876* All formatting methods are now implemented as variadic functions instead 1877 of using ``operator<<`` for feeding arbitrary arguments into a temporary 1878 formatter object. This works both with C++11 where variadic templates are 1879 used and with older standards where variadic functions are emulated by 1880 providing lightweight wrapper functions defined with the ``FMT_VARIADIC`` 1881 macro. You can use this macro for defining your own portable variadic 1882 functions: 1883 1884 .. code:: c++ 1885 1886 void report_error(const char *format, const fmt::ArgList &args) { 1887 fmt::print("Error: {}"); 1888 fmt::print(format, args); 1889 } 1890 FMT_VARIADIC(void, report_error, const char *) 1891 1892 report_error("file not found: {}", path); 1893 1894 Apart from a more natural syntax, this also improves performance as there 1895 is no need to construct temporary formatter objects and control arguments' 1896 lifetimes. Because the wrapper functions are very lightweight, this doesn't 1897 cause code bloat even in pre-C++11 mode. 1898 1899* Simplified common case of formatting an ``std::string``. Now it requires a 1900 single function call: 1901 1902 .. code:: c++ 1903 1904 std::string s = format("The answer is {}.", 42); 1905 1906 Previously it required 2 function calls: 1907 1908 .. code:: c++ 1909 1910 std::string s = str(Format("The answer is {}.") << 42); 1911 1912 Instead of unsafe ``c_str`` function, ``fmt::Writer`` should be used directly 1913 to bypass creation of ``std::string``: 1914 1915 .. code:: c++ 1916 1917 fmt::Writer w; 1918 w.write("The answer is {}.", 42); 1919 w.c_str(); // returns a C string 1920 1921 This doesn't do dynamic memory allocation for small strings and is less error 1922 prone as the lifetime of the string is the same as for ``std::string::c_str`` 1923 which is well understood (hopefully). 1924 1925* Improved consistency in naming functions that are a part of the public API. 1926 Now all public functions are lowercase following the standard library 1927 conventions. Previously it was a combination of lowercase and 1928 CapitalizedWords. 1929 Issue `#50 <https://github.com/fmtlib/fmt/issues/50>`_. 1930 1931* Old functions are marked as deprecated and will be removed in the next 1932 release. 1933 1934**Other Changes** 1935 1936* Experimental support for printf format specifications (work in progress): 1937 1938 .. code:: c++ 1939 1940 fmt::printf("The answer is %d.", 42); 1941 std::string s = fmt::sprintf("Look, a %s!", "string"); 1942 1943* Support for hexadecimal floating point format specifiers ``a`` and ``A``: 1944 1945 .. code:: c++ 1946 1947 print("{:a}", -42.0); // Prints -0x1.5p+5 1948 print("{:A}", -42.0); // Prints -0X1.5P+5 1949 1950* CMake option ``FMT_SHARED`` that specifies whether to build format as a 1951 shared library (off by default). 1952 19530.9.0 - 2014-05-13 1954------------------ 1955 1956* More efficient implementation of variadic formatting functions. 1957 1958* ``Writer::Format`` now has a variadic overload: 1959 1960 .. code:: c++ 1961 1962 Writer out; 1963 out.Format("Look, I'm {}!", "variadic"); 1964 1965* For efficiency and consistency with other overloads, variadic overload of 1966 the ``Format`` function now returns ``Writer`` instead of ``std::string``. 1967 Use the ``str`` function to convert it to ``std::string``: 1968 1969 .. code:: c++ 1970 1971 std::string s = str(Format("Look, I'm {}!", "variadic")); 1972 1973* Replaced formatter actions with output sinks: ``NoAction`` -> ``NullSink``, 1974 ``Write`` -> ``FileSink``, ``ColorWriter`` -> ``ANSITerminalSink``. 1975 This improves naming consistency and shouldn't affect client code unless 1976 these classes are used directly which should be rarely needed. 1977 1978* Added ``ThrowSystemError`` function that formats a message and throws 1979 ``SystemError`` containing the formatted message and system-specific error 1980 description. For example, the following code 1981 1982 .. code:: c++ 1983 1984 FILE *f = fopen(filename, "r"); 1985 if (!f) 1986 ThrowSystemError(errno, "Failed to open file '{}'") << filename; 1987 1988 will throw ``SystemError`` exception with description 1989 "Failed to open file '<filename>': No such file or directory" if file 1990 doesn't exist. 1991 1992* Support for AppVeyor continuous integration platform. 1993 1994* ``Format`` now throws ``SystemError`` in case of I/O errors. 1995 1996* Improve test infrastructure. Print functions are now tested by redirecting 1997 the output to a pipe. 1998 19990.8.0 - 2014-04-14 2000------------------ 2001 2002* Initial release 2003