17.1.2 - 2020-11-04 2------------------ 3 4* Fixed floating point formatting with large precision 5 (`#1976 <https://github.com/fmtlib/fmt/issues/1976>`_). 6 77.1.1 - 2020-11-01 8------------------ 9 10* Fixed ABI compatibility with 7.0.x 11 (`#1961 <https://github.com/fmtlib/fmt/issues/1961>`_). 12 13* Added the ``FMT_ARM_ABI_COMPATIBILITY`` macro to work around ABI 14 incompatibility between GCC and Clang on ARM 15 (`#1919 <https://github.com/fmtlib/fmt/issues/1919>`_). 16 17* Worked around a SFINAE bug in GCC 8 18 (`#1957 <https://github.com/fmtlib/fmt/issues/1957>`_). 19 20* Fixed linkage errors when building with GCC's LTO 21 (`#1955 <https://github.com/fmtlib/fmt/issues/1955>`_). 22 23* Fixed a compilation error when building without ``__builtin_clz`` or equivalent 24 (`#1968 <https://github.com/fmtlib/fmt/pull/1968>`_). 25 Thanks `@tohammer (Tobias Hammer) <https://github.com/tohammer>`_. 26 27* Fixed a sign conversion warning 28 (`#1964 <https://github.com/fmtlib/fmt/pull/1964>`_). 29 Thanks `@OptoCloud <https://github.com/OptoCloud>`_. 30 317.1.0 - 2020-10-25 32------------------ 33 34* Switched from `Grisu3 35 <https://www.cs.tufts.edu/~nr/cs257/archive/florian-loitsch/printf.pdf>`_ 36 to `Dragonbox <https://github.com/jk-jeon/dragonbox>`_ for the default 37 floating-point formatting which gives the shortest decimal representation 38 with round-trip guarantee and correct rounding 39 (`#1882 <https://github.com/fmtlib/fmt/pull/1882>`_, 40 `#1887 <https://github.com/fmtlib/fmt/pull/1887>`_, 41 `#1894 <https://github.com/fmtlib/fmt/pull/1894>`_). This makes {fmt} up to 42 20-30x faster than common implementations of ``std::ostringstream`` and 43 ``sprintf`` on `dtoa-benchmark <https://github.com/fmtlib/dtoa-benchmark>`_ 44 and faster than double-conversion and Ryū: 45 46 .. image:: https://user-images.githubusercontent.com/576385/ 47 95684665-11719600-0ba8-11eb-8e5b-972ff4e49428.png 48 49 It is possible to get even better performance at the cost of larger binary 50 size by compiling with the ``FMT_USE_FULL_CACHE_DRAGONBOX`` macro set to 1. 51 52 Thanks `@jk-jeon (Junekey Jeon) <https://github.com/jk-jeon>`_. 53 54* Added an experimental unsynchronized file output API which, together with 55 `format string compilation <https://fmt.dev/latest/api.html#compile-api>`_, 56 can give `5-9 times speed up compared to fprintf 57 <https://www.zverovich.net/2020/08/04/optimal-file-buffer-size.html>`_ 58 on common platforms (`godbolt <https://godbolt.org/z/nsTcG8>`__): 59 60 .. code:: c++ 61 62 #include <fmt/os.h> 63 64 int main() { 65 auto f = fmt::output_file("guide"); 66 f.print("The answer is {}.", 42); 67 } 68 69* Added a formatter for ``std::chrono::time_point<system_clock>`` 70 (`#1819 <https://github.com/fmtlib/fmt/issues/1819>`_, 71 `#1837 <https://github.com/fmtlib/fmt/pull/1837>`_). For example 72 (`godbolt <https://godbolt.org/z/c4M6fh>`__): 73 74 .. code:: c++ 75 76 #include <fmt/chrono.h> 77 78 int main() { 79 auto now = std::chrono::system_clock::now(); 80 fmt::print("The time is {:%H:%M:%S}.\n", now); 81 } 82 83 Thanks `@adamburgess (Adam Burgess) <https://github.com/adamburgess>`_. 84 85* Added support for ranges with non-const ``begin``/``end`` to ``fmt::join`` 86 (`#1784 <https://github.com/fmtlib/fmt/issues/1784>`_, 87 `#1786 <https://github.com/fmtlib/fmt/pull/1786>`_). For example 88 (`godbolt <https://godbolt.org/z/jP63Tv>`__): 89 90 .. code:: c++ 91 92 #include <fmt/ranges.h> 93 #include <range/v3/view/filter.hpp> 94 95 int main() { 96 using std::literals::string_literals::operator""s; 97 auto strs = std::array{"a"s, "bb"s, "ccc"s}; 98 auto range = strs | ranges::views::filter( 99 [] (const std::string &x) { return x.size() != 2; } 100 ); 101 fmt::print("{}\n", fmt::join(range, "")); 102 } 103 104 prints "accc". 105 106 Thanks `@tonyelewis (Tony E Lewis) <https://github.com/tonyelewis>`_. 107 108* Added a ``memory_buffer::append`` overload that takes a range 109 (`#1806 <https://github.com/fmtlib/fmt/pull/1806>`_). 110 Thanks `@BRevzin (Barry Revzin) <https://github.com/BRevzin>`_. 111 112* Improved handling of single code units in ``FMT_COMPILE``. For example: 113 114 .. code:: c++ 115 116 #include <fmt/compile.h> 117 118 char* f(char* buf) { 119 return fmt::format_to(buf, FMT_COMPILE("x{}"), 42); 120 } 121 122 compiles to just (`godbolt <https://godbolt.org/z/5vncz3>`__): 123 124 .. code:: asm 125 126 _Z1fPc: 127 movb $120, (%rdi) 128 xorl %edx, %edx 129 cmpl $42, _ZN3fmt2v76detail10basic_dataIvE23zero_or_powers_of_10_32E+8(%rip) 130 movl $3, %eax 131 seta %dl 132 subl %edx, %eax 133 movzwl _ZN3fmt2v76detail10basic_dataIvE6digitsE+84(%rip), %edx 134 cltq 135 addq %rdi, %rax 136 movw %dx, -2(%rax) 137 ret 138 139 Here a single ``mov`` instruction writes ``'x'`` (``$120``) to the output 140 buffer. 141 142* Added dynamic width support to format string compilation 143 (`#1809 <https://github.com/fmtlib/fmt/issues/1809>`_). 144 145* Improved error reporting for unformattable types: now you'll get the type name 146 directly in the error message instead of the note: 147 148 .. code:: c++ 149 150 #include <fmt/core.h> 151 152 struct how_about_no {}; 153 154 int main() { 155 fmt::print("{}", how_about_no()); 156 } 157 158 Error (`godbolt <https://godbolt.org/z/GoxM4e>`__): 159 160 ``fmt/core.h:1438:3: error: static_assert failed due to requirement 161 'fmt::v7::formattable<how_about_no>()' "Cannot format an argument. 162 To make type T formattable provide a formatter<T> specialization: 163 https://fmt.dev/latest/api.html#udt" 164 ...`` 165 166* Added the `make_args_checked <https://fmt.dev/7.1.0/api.html#argument-lists>`_ 167 function template that allows you to write formatting functions with 168 compile-time format string checks and avoid binary code bloat 169 (`godbolt <https://godbolt.org/z/PEf9qr>`__): 170 171 .. code:: c++ 172 173 void vlog(const char* file, int line, fmt::string_view format, 174 fmt::format_args args) { 175 fmt::print("{}: {}: ", file, line); 176 fmt::vprint(format, args); 177 } 178 179 template <typename S, typename... Args> 180 void log(const char* file, int line, const S& format, Args&&... args) { 181 vlog(file, line, format, 182 fmt::make_args_checked<Args...>(format, args...)); 183 } 184 185 #define MY_LOG(format, ...) \ 186 log(__FILE__, __LINE__, FMT_STRING(format), __VA_ARGS__) 187 188 MY_LOG("invalid squishiness: {}", 42); 189 190* Replaced ``snprintf`` fallback with a faster internal IEEE 754 ``float`` and 191 ``double`` formatter for arbitrary precision. For example 192 (`godbolt <https://godbolt.org/z/dPhWvj>`__): 193 194 .. code:: c++ 195 196 #include <fmt/core.h> 197 198 int main() { 199 fmt::print("{:.500}\n", 4.9406564584124654E-324); 200 } 201 202 prints 203 204 ``4.9406564584124654417656879286822137236505980261432476442558568250067550727020875186529983636163599237979656469544571773092665671035593979639877479601078187812630071319031140452784581716784898210368871863605699873072305000638740915356498438731247339727316961514003171538539807412623856559117102665855668676818703956031062493194527159149245532930545654440112748012970999954193198940908041656332452475714786901472678015935523861155013480352649347201937902681071074917033322268447533357208324319360923829e-324``. 205 206* Made ``format_to_n`` and ``formatted_size`` part of the `core API 207 <https://fmt.dev/latest/api.html#core-api>`__ 208 (`godbolt <https://godbolt.org/z/sPjY1K>`__): 209 210 .. code:: c++ 211 212 #include <fmt/core.h> 213 214 int main() { 215 char buffer[10]; 216 auto result = fmt::format_to_n(buffer, sizeof(buffer), "{}", 42); 217 } 218 219* Added ``fmt::format_to_n`` overload with format string compilation 220 (`#1764 <https://github.com/fmtlib/fmt/issues/1764>`_, 221 `#1767 <https://github.com/fmtlib/fmt/pull/1767>`_, 222 `#1869 <https://github.com/fmtlib/fmt/pull/1869>`_). For example 223 (`godbolt <https://godbolt.org/z/93h86q>`__): 224 225 .. code:: c++ 226 227 #include <fmt/compile.h> 228 229 int main() { 230 char buffer[8]; 231 fmt::format_to_n(buffer, sizeof(buffer), FMT_COMPILE("{}"), 42); 232 } 233 234 Thanks `@Kurkin (Dmitry Kurkin) <https://github.com/Kurkin>`_, 235 `@alexezeder (Alexey Ochapov) <https://github.com/alexezeder>`_. 236 237* Added ``fmt::format_to`` overload that take ``text_style`` 238 (`#1593 <https://github.com/fmtlib/fmt/issues/1593>`_, 239 `#1842 <https://github.com/fmtlib/fmt/issues/1842>`_, 240 `#1843 <https://github.com/fmtlib/fmt/pull/1843>`_). For example 241 (`godbolt <https://godbolt.org/z/91153r>`__): 242 243 .. code:: c++ 244 245 #include <fmt/color.h> 246 247 int main() { 248 std::string out; 249 fmt::format_to(std::back_inserter(out), 250 fmt::emphasis::bold | fg(fmt::color::red), 251 "The answer is {}.", 42); 252 } 253 254 Thanks `@Naios (Denis Blank) <https://github.com/Naios>`_. 255 256* Made the ``#`` specifier emit trailing zeros in addition to the decimal point 257 (`#1797 <https://github.com/fmtlib/fmt/issues/1797>`_). For example 258 (`godbolt <https://godbolt.org/z/bhdcW9>`__): 259 260 .. code:: c++ 261 262 #include <fmt/core.h> 263 264 int main() { 265 fmt::print("{:#.2g}", 0.5); 266 } 267 268 prints ``0.50``. 269 270* Changed the default floating point format to not include ``.0`` for 271 consistency with ``std::format`` and ``std::to_chars`` 272 (`#1893 <https://github.com/fmtlib/fmt/issues/1893>`_, 273 `#1943 <https://github.com/fmtlib/fmt/issues/1943>`_). It is possible to get 274 the decimal point and trailing zero with the ``#`` specifier. 275 276* Fixed an issue with floating-point formatting that could result in addition of 277 a non-significant trailing zero in rare cases e.g. ``1.00e-34`` instead of 278 ``1.0e-34`` (`#1873 <https://github.com/fmtlib/fmt/issues/1873>`_, 279 `#1917 <https://github.com/fmtlib/fmt/issues/1917>`_). 280 281* Made ``fmt::to_string`` fallback on ``ostream`` insertion operator if 282 the ``formatter`` specialization is not provided 283 (`#1815 <https://github.com/fmtlib/fmt/issues/1815>`_, 284 `#1829 <https://github.com/fmtlib/fmt/pull/1829>`_). 285 Thanks `@alexezeder (Alexey Ochapov) <https://github.com/alexezeder>`_. 286 287* Added support for the append mode to the experimental file API and 288 improved ``fcntl.h`` detection. 289 (`#1847 <https://github.com/fmtlib/fmt/pull/1847>`_, 290 `#1848 <https://github.com/fmtlib/fmt/pull/1848>`_). 291 Thanks `@t-wiser <https://github.com/t-wiser>`_. 292 293* Fixed handling of types that have both an implicit conversion operator and 294 an overloaded ``ostream`` insertion operator 295 (`#1766 <https://github.com/fmtlib/fmt/issues/1766>`_). 296 297* Fixed a slicing issue in an internal iterator type 298 (`#1822 <https://github.com/fmtlib/fmt/pull/1822>`_). 299 Thanks `@BRevzin (Barry Revzin) <https://github.com/BRevzin>`_. 300 301* Fixed an issue in locale-specific integer formatting 302 (`#1927 <https://github.com/fmtlib/fmt/issues/1927>`_). 303 304* Fixed handling of exotic code unit types 305 (`#1870 <https://github.com/fmtlib/fmt/issues/1870>`_, 306 `#1932 <https://github.com/fmtlib/fmt/issues/1932>`_). 307 308* Improved ``FMT_ALWAYS_INLINE`` 309 (`#1878 <https://github.com/fmtlib/fmt/pull/1878>`_). 310 Thanks `@jk-jeon (Junekey Jeon) <https://github.com/jk-jeon>`_. 311 312* Removed dependency on ``windows.h`` 313 (`#1900 <https://github.com/fmtlib/fmt/pull/1900>`_). 314 Thanks `@bernd5 (Bernd Baumanns) <https://github.com/bernd5>`_. 315 316* Optimized counting of decimal digits on MSVC 317 (`#1890 <https://github.com/fmtlib/fmt/pull/1890>`_). 318 Thanks `@mwinterb <https://github.com/mwinterb>`_. 319 320* Improved documentation 321 (`#1772 <https://github.com/fmtlib/fmt/issues/1772>`_, 322 `#1775 <https://github.com/fmtlib/fmt/pull/1775>`_, 323 `#1792 <https://github.com/fmtlib/fmt/pull/1792>`_, 324 `#1838 <https://github.com/fmtlib/fmt/pull/1838>`_, 325 `#1888 <https://github.com/fmtlib/fmt/pull/1888>`_, 326 `#1918 <https://github.com/fmtlib/fmt/pull/1918>`_, 327 `#1939 <https://github.com/fmtlib/fmt/pull/1939>`_). 328 Thanks `@leolchat (Léonard Gérard) <https://github.com/leolchat>`_, 329 `@pepsiman (Malcolm Parsons) <https://github.com/pepsiman>`_, 330 `@Klaim (Joël Lamotte) <https://github.com/Klaim>`_, 331 `@ravijanjam (Ravi J) <https://github.com/ravijanjam>`_, 332 `@francesco-st <https://github.com/francesco-st>`_, 333 `@udnaan (Adnan) <https://github.com/udnaan>`_. 334 335* Added the ``FMT_REDUCE_INT_INSTANTIATIONS`` CMake option that reduces the 336 binary code size at the cost of some integer formatting performance. This can 337 be useful for extremely memory-constrained embedded systems 338 (`#1778 <https://github.com/fmtlib/fmt/issues/1778>`_, 339 `#1781 <https://github.com/fmtlib/fmt/pull/1781>`_). 340 Thanks `@kammce (Khalil Estell) <https://github.com/kammce>`_. 341 342* Added the ``FMT_USE_INLINE_NAMESPACES`` macro to control usage of inline 343 namespaces (`#1945 <https://github.com/fmtlib/fmt/pull/1945>`_). 344 Thanks `@darklukee <https://github.com/darklukee>`_. 345 346* Improved build configuration 347 (`#1760 <https://github.com/fmtlib/fmt/pull/1760>`_, 348 `#1770 <https://github.com/fmtlib/fmt/pull/1770>`_, 349 `#1779 <https://github.com/fmtlib/fmt/issues/1779>`_, 350 `#1783 <https://github.com/fmtlib/fmt/pull/1783>`_, 351 `#1823 <https://github.com/fmtlib/fmt/pull/1823>`_). 352 Thanks `@dvetutnev (Dmitriy Vetutnev) <https://github.com/dvetutnev>`_, 353 `@xvitaly (Vitaly Zaitsev) <https://github.com/xvitaly>`_, 354 `@tambry (Raul Tambre) <https://github.com/tambry>`_, 355 `@medithe <https://github.com/medithe>`_, 356 `@martinwuehrer (Martin Wührer) <https://github.com/martinwuehrer>`_. 357 358* Fixed various warnings and compilation issues 359 (`#1790 <https://github.com/fmtlib/fmt/pull/1790>`_, 360 `#1802 <https://github.com/fmtlib/fmt/pull/1802>`_, 361 `#1808 <https://github.com/fmtlib/fmt/pull/1808>`_, 362 `#1810 <https://github.com/fmtlib/fmt/issues/1810>`_, 363 `#1811 <https://github.com/fmtlib/fmt/issues/1811>`_, 364 `#1812 <https://github.com/fmtlib/fmt/pull/1812>`_, 365 `#1814 <https://github.com/fmtlib/fmt/pull/1814>`_, 366 `#1816 <https://github.com/fmtlib/fmt/pull/1816>`_, 367 `#1817 <https://github.com/fmtlib/fmt/pull/1817>`_, 368 `#1818 <https://github.com/fmtlib/fmt/pull/1818>`_, 369 `#1825 <https://github.com/fmtlib/fmt/issues/1825>`_, 370 `#1836 <https://github.com/fmtlib/fmt/pull/1836>`_, 371 `#1855 <https://github.com/fmtlib/fmt/pull/1855>`_, 372 `#1856 <https://github.com/fmtlib/fmt/pull/1856>`_, 373 `#1860 <https://github.com/fmtlib/fmt/pull/1860>`_, 374 `#1877 <https://github.com/fmtlib/fmt/pull/1877>`_, 375 `#1879 <https://github.com/fmtlib/fmt/pull/1879>`_, 376 `#1880 <https://github.com/fmtlib/fmt/pull/1880>`_, 377 `#1896 <https://github.com/fmtlib/fmt/issues/1896>`_, 378 `#1897 <https://github.com/fmtlib/fmt/pull/1897>`_, 379 `#1898 <https://github.com/fmtlib/fmt/pull/1898>`_, 380 `#1904 <https://github.com/fmtlib/fmt/issues/1904>`_, 381 `#1908 <https://github.com/fmtlib/fmt/pull/1908>`_, 382 `#1911 <https://github.com/fmtlib/fmt/issues/1911>`_, 383 `#1912 <https://github.com/fmtlib/fmt/issues/1912>`_, 384 `#1928 <https://github.com/fmtlib/fmt/issues/1928>`_, 385 `#1929 <https://github.com/fmtlib/fmt/pull/1929>`_, 386 `#1935 <https://github.com/fmtlib/fmt/issues/1935>`_ 387 `#1937 <https://github.com/fmtlib/fmt/pull/1937>`_, 388 `#1942 <https://github.com/fmtlib/fmt/pull/1942>`_, 389 `#1949 <https://github.com/fmtlib/fmt/issues/1949>`_). 390 Thanks `@TheQwertiest <https://github.com/TheQwertiest>`_, 391 `@medithe <https://github.com/medithe>`_, 392 `@martinwuehrer (Martin Wührer) <https://github.com/martinwuehrer>`_, 393 `@n16h7hunt3r <https://github.com/n16h7hunt3r>`_, 394 `@Othereum (Seokjin Lee) <https://github.com/Othereum>`_, 395 `@gsjaardema (Greg Sjaardema) <https://github.com/gsjaardema>`_, 396 `@AlexanderLanin (Alexander Lanin) <https://github.com/AlexanderLanin>`_, 397 `@gcerretani (Giovanni Cerretani) <https://github.com/gcerretani>`_, 398 `@chronoxor (Ivan Shynkarenka) <https://github.com/chronoxor>`_, 399 `@noizefloor (Jan Schwers) <https://github.com/noizefloor>`_, 400 `@akohlmey (Axel Kohlmeyer) <https://github.com/akohlmey>`_, 401 `@jk-jeon (Junekey Jeon) <https://github.com/jk-jeon>`_, 402 `@rimathia <https://github.com/rimathia>`_, 403 `@rglarix (Riccardo Ghetta (larix)) <https://github.com/rglarix>`_, 404 `@moiwi <https://github.com/moiwi>`_, 405 `@heckad (Kazantcev Andrey) <https://github.com/heckad>`_, 406 `@MarcDirven <https://github.com/MarcDirven>`_. 407 `@BartSiwek (Bart Siwek) <https://github.com/BartSiwek>`_, 408 `@darklukee <https://github.com/darklukee>`_. 409 4107.0.3 - 2020-08-06 411------------------ 412 413* Worked around broken ``numeric_limits`` for 128-bit integers 414 (`#1787 <https://github.com/fmtlib/fmt/issues/1787>`_). 415 416* Added error reporting on missing named arguments 417 (`#1796 <https://github.com/fmtlib/fmt/issues/1796>`_). 418 419* Stopped using 128-bit integers with clang-cl 420 (`#1800 <https://github.com/fmtlib/fmt/pull/1800>`_). 421 Thanks `@Kingcom <https://github.com/Kingcom>`_. 422 423* Fixed issues in locale-specific integer formatting 424 (`#1782 <https://github.com/fmtlib/fmt/issues/1782>`_, 425 `#1801 <https://github.com/fmtlib/fmt/issues/1801>`_). 426 4277.0.2 - 2020-07-29 428------------------ 429 430* Worked around broken ``numeric_limits`` for 128-bit integers 431 (`#1725 <https://github.com/fmtlib/fmt/issues/1725>`_). 432 433* Fixed compatibility with CMake 3.4 434 (`#1779 <https://github.com/fmtlib/fmt/issues/1779>`_). 435 436* Fixed handling of digit separators in locale-specific formatting 437 (`#1782 <https://github.com/fmtlib/fmt/issues/1782>`_). 438 4397.0.1 - 2020-07-07 440------------------ 441 442* Updated the inline version namespace name. 443 444* Worked around a gcc bug in mangling of alias templates 445 (`#1753 <https://github.com/fmtlib/fmt/issues/1753>`_). 446 447* Fixed a linkage error on Windows 448 (`#1757 <https://github.com/fmtlib/fmt/issues/1757>`_). 449 Thanks `@Kurkin (Dmitry Kurkin) <https://github.com/Kurkin>`_. 450 451* Fixed minor issues with the documentation. 452 4537.0.0 - 2020-07-05 454------------------ 455 456* Reduced the library size. For example, on macOS a stripped test binary 457 statically linked with {fmt} `shrank from ~368k to less than 100k 458 <http://www.zverovich.net/2020/05/21/reducing-library-size.html>`_. 459 460* Added a simpler and more efficient `format string compilation API 461 <https://fmt.dev/7.0.0/api.html#compile-api>`_: 462 463 .. code:: c++ 464 465 #include <fmt/compile.h> 466 467 // Converts 42 into std::string using the most efficient method and no 468 // runtime format string processing. 469 std::string s = fmt::format(FMT_COMPILE("{}"), 42); 470 471 The old ``fmt::compile`` API is now deprecated. 472 473* Optimized integer formatting: ``format_to`` with format string compilation 474 and a stack-allocated buffer is now `faster than to_chars on both 475 libc++ and libstdc++ 476 <http://www.zverovich.net/2020/06/13/fast-int-to-string-revisited.html>`_. 477 478* Optimized handling of small format strings. For example, 479 480 .. code:: c++ 481 482 fmt::format("Result: {}: ({},{},{},{})", str1, str2, str3, str4, str5) 483 484 is now ~40% faster (`#1685 <https://github.com/fmtlib/fmt/issues/1685>`_). 485 486* Applied extern templates to improve compile times when using the core API 487 and ``fmt/format.h`` (`#1452 <https://github.com/fmtlib/fmt/issues/1452>`_). 488 For example, on macOS with clang the compile time of a test translation unit 489 dropped from 2.3s to 0.3s with ``-O2`` and from 0.6s to 0.3s with the default 490 settings (``-O0``). 491 492 Before (``-O2``):: 493 494 % time c++ -c test.cc -I include -std=c++17 -O2 495 c++ -c test.cc -I include -std=c++17 -O2 2.22s user 0.08s system 99% cpu 2.311 total 496 497 After (``-O2``):: 498 499 % time c++ -c test.cc -I include -std=c++17 -O2 500 c++ -c test.cc -I include -std=c++17 -O2 0.26s user 0.04s system 98% cpu 0.303 total 501 502 Before (default):: 503 504 % time c++ -c test.cc -I include -std=c++17 505 c++ -c test.cc -I include -std=c++17 0.53s user 0.06s system 98% cpu 0.601 total 506 507 After (default):: 508 509 % time c++ -c test.cc -I include -std=c++17 510 c++ -c test.cc -I include -std=c++17 0.24s user 0.06s system 98% cpu 0.301 total 511 512 It is still recommended to use ``fmt/core.h`` instead of ``fmt/format.h`` but 513 the compile time difference is now smaller. Thanks 514 `@alex3d <https://github.com/alex3d>`_ for the suggestion. 515 516* Named arguments are now stored on stack (no dynamic memory allocations) and 517 the compiled code is more compact and efficient. For example 518 519 .. code:: c++ 520 521 #include <fmt/core.h> 522 523 int main() { 524 fmt::print("The answer is {answer}\n", fmt::arg("answer", 42)); 525 } 526 527 compiles to just (`godbolt <https://godbolt.org/z/NcfEp_>`__) 528 529 .. code:: asm 530 531 .LC0: 532 .string "answer" 533 .LC1: 534 .string "The answer is {answer}\n" 535 main: 536 sub rsp, 56 537 mov edi, OFFSET FLAT:.LC1 538 mov esi, 23 539 movabs rdx, 4611686018427387905 540 lea rax, [rsp+32] 541 lea rcx, [rsp+16] 542 mov QWORD PTR [rsp+8], 1 543 mov QWORD PTR [rsp], rax 544 mov DWORD PTR [rsp+16], 42 545 mov QWORD PTR [rsp+32], OFFSET FLAT:.LC0 546 mov DWORD PTR [rsp+40], 0 547 call fmt::v6::vprint(fmt::v6::basic_string_view<char>, 548 fmt::v6::format_args) 549 xor eax, eax 550 add rsp, 56 551 ret 552 553 .L.str.1: 554 .asciz "answer" 555 556* Implemented compile-time checks for dynamic width and precision 557 (`#1614 <https://github.com/fmtlib/fmt/issues/1614>`_): 558 559 .. code:: c++ 560 561 #include <fmt/format.h> 562 563 int main() { 564 fmt::print(FMT_STRING("{0:{1}}"), 42); 565 } 566 567 now gives a compilation error because argument 1 doesn't exist:: 568 569 In file included from test.cc:1: 570 include/fmt/format.h:2726:27: error: constexpr variable 'invalid_format' must be 571 initialized by a constant expression 572 FMT_CONSTEXPR_DECL bool invalid_format = 573 ^ 574 ... 575 include/fmt/core.h:569:26: note: in call to 576 '&checker(s, {}).context_->on_error(&"argument not found"[0])' 577 if (id >= num_args_) on_error("argument not found"); 578 ^ 579 580* Added sentinel support to ``fmt::join`` 581 (`#1689 <https://github.com/fmtlib/fmt/pull/1689>`_) 582 583 .. code:: c++ 584 585 struct zstring_sentinel {}; 586 bool operator==(const char* p, zstring_sentinel) { return *p == '\0'; } 587 bool operator!=(const char* p, zstring_sentinel) { return *p != '\0'; } 588 589 struct zstring { 590 const char* p; 591 const char* begin() const { return p; } 592 zstring_sentinel end() const { return {}; } 593 }; 594 595 auto s = fmt::format("{}", fmt::join(zstring{"hello"}, "_")); 596 // s == "h_e_l_l_o" 597 598 Thanks `@BRevzin (Barry Revzin) <https://github.com/BRevzin>`_. 599 600* Added support for named arguments, ``clear`` and ``reserve`` to 601 ``dynamic_format_arg_store`` 602 (`#1655 <https://github.com/fmtlib/fmt/issues/1655>`_, 603 `#1663 <https://github.com/fmtlib/fmt/pull/1663>`_, 604 `#1674 <https://github.com/fmtlib/fmt/pull/1674>`_, 605 `#1677 <https://github.com/fmtlib/fmt/pull/1677>`_). 606 Thanks `@vsolontsov-ll (Vladimir Solontsov) 607 <https://github.com/vsolontsov-ll>`_. 608 609* Added support for the ``'c'`` format specifier to integral types for 610 compatibility with ``std::format`` 611 (`#1652 <https://github.com/fmtlib/fmt/issues/1652>`_). 612 613* Replaced the ``'n'`` format specifier with ``'L'`` for compatibility with 614 ``std::format`` (`#1624 <https://github.com/fmtlib/fmt/issues/1624>`_). 615 The ``'n'`` specifier can be enabled via the ``FMT_DEPRECATED_N_SPECIFIER`` 616 macro. 617 618* The ``'='`` format specifier is now disabled by default for compatibility with 619 ``std::format``. It can be enabled via the ``FMT_DEPRECATED_NUMERIC_ALIGN`` 620 macro. 621 622* Removed the following deprecated APIs: 623 624 * ``FMT_STRING_ALIAS`` and ``fmt`` macros - replaced by ``FMT_STRING`` 625 * ``fmt::basic_string_view::char_type`` - replaced by 626 ``fmt::basic_string_view::value_type`` 627 * ``convert_to_int`` 628 * ``format_arg_store::types`` 629 * ``*parse_context`` - replaced by ``*format_parse_context`` 630 * ``FMT_DEPRECATED_INCLUDE_OS`` 631 * ``FMT_DEPRECATED_PERCENT`` - incompatible with ``std::format`` 632 * ``*writer`` - replaced by compiled format API 633 634* Renamed the ``internal`` namespace to ``detail`` 635 (`#1538 <https://github.com/fmtlib/fmt/issues/1538>`_). The former is still 636 provided as an alias if the ``FMT_USE_INTERNAL`` macro is defined. 637 638* Improved compatibility between ``fmt::printf`` with the standard specs 639 (`#1595 <https://github.com/fmtlib/fmt/issues/1595>`_, 640 `#1682 <https://github.com/fmtlib/fmt/pull/1682>`_, 641 `#1683 <https://github.com/fmtlib/fmt/pull/1683>`_, 642 `#1687 <https://github.com/fmtlib/fmt/pull/1687>`_, 643 `#1699 <https://github.com/fmtlib/fmt/pull/1699>`_). 644 Thanks `@rimathia <https://github.com/rimathia>`_. 645 646* Fixed handling of ``operator<<`` overloads that use ``copyfmt`` 647 (`#1666 <https://github.com/fmtlib/fmt/issues/1666>`_). 648 649* Added the ``FMT_OS`` CMake option to control inclusion of OS-specific APIs 650 in the fmt target. This can be useful for embedded platforms 651 (`#1654 <https://github.com/fmtlib/fmt/issues/1654>`_, 652 `#1656 <https://github.com/fmtlib/fmt/pull/1656>`_). 653 Thanks `@kwesolowski (Krzysztof Wesolowski) 654 <https://github.com/kwesolowski>`_. 655 656* Replaced ``FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION`` with the ``FMT_FUZZ`` 657 macro to prevent interferring with fuzzing of projects using {fmt} 658 (`#1650 <https://github.com/fmtlib/fmt/pull/1650>`_). 659 Thanks `@asraa (Asra Ali) <https://github.com/asraa>`_. 660 661* Fixed compatibility with emscripten 662 (`#1636 <https://github.com/fmtlib/fmt/issues/1636>`_, 663 `#1637 <https://github.com/fmtlib/fmt/pull/1637>`_). 664 Thanks `@ArthurSonzogni (Arthur Sonzogni) 665 <https://github.com/ArthurSonzogni>`_. 666 667* Improved documentation 668 (`#704 <https://github.com/fmtlib/fmt/issues/704>`_, 669 `#1643 <https://github.com/fmtlib/fmt/pull/1643>`_, 670 `#1660 <https://github.com/fmtlib/fmt/pull/1660>`_, 671 `#1681 <https://github.com/fmtlib/fmt/pull/1681>`_, 672 `#1691 <https://github.com/fmtlib/fmt/pull/1691>`_, 673 `#1706 <https://github.com/fmtlib/fmt/pull/1706>`_, 674 `#1714 <https://github.com/fmtlib/fmt/pull/1714>`_, 675 `#1721 <https://github.com/fmtlib/fmt/pull/1721>`_, 676 `#1739 <https://github.com/fmtlib/fmt/pull/1739>`_, 677 `#1740 <https://github.com/fmtlib/fmt/pull/1740>`_, 678 `#1741 <https://github.com/fmtlib/fmt/pull/1741>`_, 679 `#1751 <https://github.com/fmtlib/fmt/pull/1751>`_). 680 Thanks `@senior7515 (Alexander Gallego) <https://github.com/senior7515>`_, 681 `@lsr0 (Lindsay Roberts) <https://github.com/lsr0>`_, 682 `@puetzk (Kevin Puetz) <https://github.com/puetzk>`_, 683 `@fpelliccioni (Fernando Pelliccioni) <https://github.com/fpelliccioni>`_, 684 Alexey Kuzmenko, `@jelly (jelle van der Waa) <https://github.com/jelly>`_, 685 `@claremacrae (Clare Macrae) <https://github.com/claremacrae>`_, 686 `@jiapengwen (文佳鹏) <https://github.com/jiapengwen>`_, 687 `@gsjaardema (Greg Sjaardema) <https://github.com/gsjaardema>`_, 688 `@alexey-milovidov <https://github.com/alexey-milovidov>`_. 689 690* Implemented various build configuration fixes and improvements 691 (`#1603 <https://github.com/fmtlib/fmt/pull/1603>`_, 692 `#1657 <https://github.com/fmtlib/fmt/pull/1657>`_, 693 `#1702 <https://github.com/fmtlib/fmt/pull/1702>`_, 694 `#1728 <https://github.com/fmtlib/fmt/pull/1728>`_). 695 Thanks `@scramsby (Scott Ramsby) <https://github.com/scramsby>`_, 696 `@jtojnar (Jan Tojnar) <https://github.com/jtojnar>`_, 697 `@orivej (Orivej Desh) <https://github.com/orivej>`_, 698 `@flagarde <https://github.com/flagarde>`_. 699 700* Fixed various warnings and compilation issues 701 (`#1616 <https://github.com/fmtlib/fmt/pull/1616>`_, 702 `#1620 <https://github.com/fmtlib/fmt/issues/1620>`_, 703 `#1622 <https://github.com/fmtlib/fmt/issues/1622>`_, 704 `#1625 <https://github.com/fmtlib/fmt/issues/1625>`_, 705 `#1627 <https://github.com/fmtlib/fmt/pull/1627>`_, 706 `#1628 <https://github.com/fmtlib/fmt/issues/1628>`_, 707 `#1629 <https://github.com/fmtlib/fmt/pull/1629>`_, 708 `#1631 <https://github.com/fmtlib/fmt/issues/1631>`_, 709 `#1633 <https://github.com/fmtlib/fmt/pull/1633>`_, 710 `#1649 <https://github.com/fmtlib/fmt/pull/1649>`_, 711 `#1658 <https://github.com/fmtlib/fmt/issues/1658>`_, 712 `#1661 <https://github.com/fmtlib/fmt/pull/1661>`_, 713 `#1667 <https://github.com/fmtlib/fmt/pull/1667>`_, 714 `#1668 <https://github.com/fmtlib/fmt/issues/1668>`_, 715 `#1669 <https://github.com/fmtlib/fmt/pull/1669>`_, 716 `#1692 <https://github.com/fmtlib/fmt/issues/1692>`_, 717 `#1696 <https://github.com/fmtlib/fmt/pull/1696>`_, 718 `#1697 <https://github.com/fmtlib/fmt/pull/1697>`_, 719 `#1707 <https://github.com/fmtlib/fmt/issues/1707>`_, 720 `#1712 <https://github.com/fmtlib/fmt/pull/1712>`_, 721 `#1716 <https://github.com/fmtlib/fmt/pull/1716>`_, 722 `#1722 <https://github.com/fmtlib/fmt/pull/1722>`_, 723 `#1724 <https://github.com/fmtlib/fmt/issues/1724>`_, 724 `#1729 <https://github.com/fmtlib/fmt/pull/1729>`_, 725 `#1738 <https://github.com/fmtlib/fmt/pull/1738>`_, 726 `#1742 <https://github.com/fmtlib/fmt/issues/1742>`_, 727 `#1743 <https://github.com/fmtlib/fmt/issues/1743>`_, 728 `#1744 <https://github.com/fmtlib/fmt/pull/1744>`_, 729 `#1747 <https://github.com/fmtlib/fmt/issues/1747>`_, 730 `#1750 <https://github.com/fmtlib/fmt/pull/1750>`_). 731 Thanks `@gsjaardema (Greg Sjaardema) <https://github.com/gsjaardema>`_, 732 `@gabime (Gabi Melman) <https://github.com/gabime>`_, 733 `@johnor (Johan) <https://github.com/johnor>`_, 734 `@Kurkin (Dmitry Kurkin) <https://github.com/Kurkin>`_, 735 `@invexed (James Beach) <https://github.com/invexed>`_, 736 `@peterbell10 <https://github.com/peterbell10>`_, 737 `@daixtrose (Markus Werle) <https://github.com/daixtrose>`_, 738 `@petrutlucian94 (Lucian Petrut) <https://github.com/petrutlucian94>`_, 739 `@Neargye (Daniil Goncharov) <https://github.com/Neargye>`_, 740 `@ambitslix (Attila M. Szilagyi) <https://github.com/ambitslix>`_, 741 `@gabime (Gabi Melman) <https://github.com/gabime>`_, 742 `@erthink (Leonid Yuriev) <https://github.com/erthink>`_, 743 `@tohammer (Tobias Hammer) <https://github.com/tohammer>`_, 744 `@0x8000-0000 (Florin Iucha) <https://github.com/0x8000-0000>`_. 745 7466.2.1 - 2020-05-09 747------------------ 748 749* Fixed ostream support in ``sprintf`` 750 (`#1631 <https://github.com/fmtlib/fmt/issues/1631>`_). 751 752* Fixed type detection when using implicit conversion to ``string_view`` and 753 ostream ``operator<<`` inconsistently 754 (`#1662 <https://github.com/fmtlib/fmt/issues/1662>`_). 755 7566.2.0 - 2020-04-05 757------------------ 758 759* Improved error reporting when trying to format an object of a non-formattable 760 type: 761 762 .. code:: c++ 763 764 fmt::format("{}", S()); 765 766 now gives:: 767 768 include/fmt/core.h:1015:5: error: static_assert failed due to requirement 769 'formattable' "Cannot format argument. To make type T formattable provide a 770 formatter<T> specialization: 771 https://fmt.dev/latest/api.html#formatting-user-defined-types" 772 static_assert( 773 ^ 774 ... 775 note: in instantiation of function template specialization 776 'fmt::v6::format<char [3], S, char>' requested here 777 fmt::format("{}", S()); 778 ^ 779 780 if ``S`` is not formattable. 781 782* Reduced the library size by ~10%. 783 784* Always print decimal point if ``#`` is specified 785 (`#1476 <https://github.com/fmtlib/fmt/issues/1476>`_, 786 `#1498 <https://github.com/fmtlib/fmt/issues/1498>`_): 787 788 .. code:: c++ 789 790 fmt::print("{:#.0f}", 42.0); 791 792 now prints ``42.`` 793 794* Implemented the ``'L'`` specifier for locale-specific numeric formatting to 795 improve compatibility with ``std::format``. The ``'n'`` specifier is now 796 deprecated and will be removed in the next major release. 797 798* Moved OS-specific APIs such as ``windows_error`` from ``fmt/format.h`` to 799 ``fmt/os.h``. You can define ``FMT_DEPRECATED_INCLUDE_OS`` to automatically 800 include ``fmt/os.h`` from ``fmt/format.h`` for compatibility but this will be 801 disabled in the next major release. 802 803* Added precision overflow detection in floating-point formatting. 804 805* Implemented detection of invalid use of ``fmt::arg``. 806 807* Used ``type_identity`` to block unnecessary template argument deduction. 808 Thanks Tim Song. 809 810* Improved UTF-8 handling 811 (`#1109 <https://github.com/fmtlib/fmt/issues/1109>`_): 812 813 .. code:: c++ 814 815 fmt::print("┌{0:─^{2}}┐\n" 816 "│{1: ^{2}}│\n" 817 "└{0:─^{2}}┘\n", "", "Привет, мир!", 20); 818 819 now prints:: 820 821 ┌────────────────────┐ 822 │ Привет, мир! │ 823 └────────────────────┘ 824 825 on systems that support Unicode. 826 827* Added experimental dynamic argument storage 828 (`#1170 <https://github.com/fmtlib/fmt/issues/1170>`_, 829 `#1584 <https://github.com/fmtlib/fmt/pull/1584>`_): 830 831 .. code:: c++ 832 833 fmt::dynamic_format_arg_store<fmt::format_context> store; 834 store.push_back("answer"); 835 store.push_back(42); 836 fmt::vprint("The {} is {}.\n", store); 837 838 prints:: 839 840 The answer is 42. 841 842 Thanks `@vsolontsov-ll (Vladimir Solontsov) 843 <https://github.com/vsolontsov-ll>`_. 844 845* Made ``fmt::join`` accept ``initializer_list`` 846 (`#1591 <https://github.com/fmtlib/fmt/pull/1591>`_). 847 Thanks `@Rapotkinnik (Nikolay Rapotkin) <https://github.com/Rapotkinnik>`_. 848 849* Fixed handling of empty tuples 850 (`#1588 <https://github.com/fmtlib/fmt/issues/1588>`_). 851 852* Fixed handling of output iterators in ``format_to_n`` 853 (`#1506 <https://github.com/fmtlib/fmt/issues/1506>`_). 854 855* Fixed formatting of ``std::chrono::duration`` types to wide output 856 (`#1533 <https://github.com/fmtlib/fmt/pull/1533>`_). 857 Thanks `@zeffy (pilao) <https://github.com/zeffy>`_. 858 859* Added const ``begin`` and ``end`` overload to buffers 860 (`#1553 <https://github.com/fmtlib/fmt/pull/1553>`_). 861 Thanks `@dominicpoeschko <https://github.com/dominicpoeschko>`_. 862 863* Added the ability to disable floating-point formatting via ``FMT_USE_FLOAT``, 864 ``FMT_USE_DOUBLE`` and ``FMT_USE_LONG_DOUBLE`` macros for extremely 865 memory-constrained embedded system 866 (`#1590 <https://github.com/fmtlib/fmt/pull/1590>`_). 867 Thanks `@albaguirre (Alberto Aguirre) <https://github.com/albaguirre>`_. 868 869* Made ``FMT_STRING`` work with ``constexpr`` ``string_view`` 870 (`#1589 <https://github.com/fmtlib/fmt/pull/1589>`_). 871 Thanks `@scramsby (Scott Ramsby) <https://github.com/scramsby>`_. 872 873* Implemented a minor optimization in the format string parser 874 (`#1560 <https://github.com/fmtlib/fmt/pull/1560>`_). 875 Thanks `@IkarusDeveloper <https://github.com/IkarusDeveloper>`_. 876 877* Improved attribute detection 878 (`#1469 <https://github.com/fmtlib/fmt/pull/1469>`_, 879 `#1475 <https://github.com/fmtlib/fmt/pull/1475>`_, 880 `#1576 <https://github.com/fmtlib/fmt/pull/1576>`_). 881 Thanks `@federico-busato (Federico) <https://github.com/federico-busato>`_, 882 `@chronoxor (Ivan Shynkarenka) <https://github.com/chronoxor>`_, 883 `@refnum <https://github.com/refnum>`_. 884 885* Improved documentation 886 (`#1481 <https://github.com/fmtlib/fmt/pull/1481>`_, 887 `#1523 <https://github.com/fmtlib/fmt/pull/1523>`_). 888 Thanks `@JackBoosY (Jack·Boos·Yu) <https://github.com/JackBoosY>`_, 889 `@imba-tjd (谭九鼎) <https://github.com/imba-tjd>`_. 890 891* Fixed symbol visibility on Linux when compiling with ``-fvisibility=hidden`` 892 (`#1535 <https://github.com/fmtlib/fmt/pull/1535>`_). 893 Thanks `@milianw (Milian Wolff) <https://github.com/milianw>`_. 894 895* Implemented various build configuration fixes and improvements 896 (`#1264 <https://github.com/fmtlib/fmt/issues/1264>`_, 897 `#1460 <https://github.com/fmtlib/fmt/issues/1460>`_, 898 `#1534 <https://github.com/fmtlib/fmt/pull/1534>`_, 899 `#1536 <https://github.com/fmtlib/fmt/issues/1536>`_, 900 `#1545 <https://github.com/fmtlib/fmt/issues/1545>`_, 901 `#1546 <https://github.com/fmtlib/fmt/pull/1546>`_, 902 `#1566 <https://github.com/fmtlib/fmt/issues/1566>`_, 903 `#1582 <https://github.com/fmtlib/fmt/pull/1582>`_, 904 `#1597 <https://github.com/fmtlib/fmt/issues/1597>`_, 905 `#1598 <https://github.com/fmtlib/fmt/pull/1598>`_). 906 Thanks `@ambitslix (Attila M. Szilagyi) <https://github.com/ambitslix>`_, 907 `@jwillikers (Jordan Williams) <https://github.com/jwillikers>`_, 908 `@stac47 (Laurent Stacul) <https://github.com/stac47>`_. 909 910* Fixed various warnings and compilation issues 911 (`#1433 <https://github.com/fmtlib/fmt/pull/1433>`_, 912 `#1461 <https://github.com/fmtlib/fmt/issues/1461>`_, 913 `#1470 <https://github.com/fmtlib/fmt/pull/1470>`_, 914 `#1480 <https://github.com/fmtlib/fmt/pull/1480>`_, 915 `#1485 <https://github.com/fmtlib/fmt/pull/1485>`_, 916 `#1492 <https://github.com/fmtlib/fmt/pull/1492>`_, 917 `#1493 <https://github.com/fmtlib/fmt/issues/1493>`_, 918 `#1504 <https://github.com/fmtlib/fmt/issues/1504>`_, 919 `#1505 <https://github.com/fmtlib/fmt/pull/1505>`_, 920 `#1512 <https://github.com/fmtlib/fmt/pull/1512>`_, 921 `#1515 <https://github.com/fmtlib/fmt/issues/1515>`_, 922 `#1516 <https://github.com/fmtlib/fmt/pull/1516>`_, 923 `#1518 <https://github.com/fmtlib/fmt/pull/1518>`_, 924 `#1519 <https://github.com/fmtlib/fmt/pull/1519>`_, 925 `#1520 <https://github.com/fmtlib/fmt/pull/1520>`_, 926 `#1521 <https://github.com/fmtlib/fmt/pull/1521>`_, 927 `#1522 <https://github.com/fmtlib/fmt/pull/1522>`_, 928 `#1524 <https://github.com/fmtlib/fmt/issues/1524>`_, 929 `#1530 <https://github.com/fmtlib/fmt/pull/1530>`_, 930 `#1531 <https://github.com/fmtlib/fmt/issues/1531>`_, 931 `#1532 <https://github.com/fmtlib/fmt/pull/1532>`_, 932 `#1539 <https://github.com/fmtlib/fmt/issues/1539>`_, 933 `#1547 <https://github.com/fmtlib/fmt/issues/1547>`_, 934 `#1548 <https://github.com/fmtlib/fmt/issues/1548>`_, 935 `#1554 <https://github.com/fmtlib/fmt/pull/1554>`_, 936 `#1567 <https://github.com/fmtlib/fmt/issues/1567>`_, 937 `#1568 <https://github.com/fmtlib/fmt/pull/1568>`_, 938 `#1569 <https://github.com/fmtlib/fmt/pull/1569>`_, 939 `#1571 <https://github.com/fmtlib/fmt/pull/1571>`_, 940 `#1573 <https://github.com/fmtlib/fmt/pull/1573>`_, 941 `#1575 <https://github.com/fmtlib/fmt/pull/1575>`_, 942 `#1581 <https://github.com/fmtlib/fmt/pull/1581>`_, 943 `#1583 <https://github.com/fmtlib/fmt/issues/1583>`_, 944 `#1586 <https://github.com/fmtlib/fmt/issues/1586>`_, 945 `#1587 <https://github.com/fmtlib/fmt/issues/1587>`_, 946 `#1594 <https://github.com/fmtlib/fmt/issues/1594>`_, 947 `#1596 <https://github.com/fmtlib/fmt/pull/1596>`_, 948 `#1604 <https://github.com/fmtlib/fmt/issues/1604>`_, 949 `#1606 <https://github.com/fmtlib/fmt/pull/1606>`_, 950 `#1607 <https://github.com/fmtlib/fmt/issues/1607>`_, 951 `#1609 <https://github.com/fmtlib/fmt/issues/1609>`_). 952 Thanks `@marti4d (Chris Martin) <https://github.com/marti4d>`_, 953 `@iPherian <https://github.com/iPherian>`_, 954 `@parkertomatoes <https://github.com/parkertomatoes>`_, 955 `@gsjaardema (Greg Sjaardema) <https://github.com/gsjaardema>`_, 956 `@chronoxor (Ivan Shynkarenka) <https://github.com/chronoxor>`_, 957 `@DanielaE (Daniela Engert) <https://github.com/DanielaE>`_, 958 `@torsten48 <https://github.com/torsten48>`_, 959 `@tohammer (Tobias Hammer) <https://github.com/tohammer>`_, 960 `@lefticus (Jason Turner) <https://github.com/lefticus>`_, 961 `@ryusakki (Haise) <https://github.com/ryusakki>`_, 962 `@adnsv (Alex Denisov) <https://github.com/adnsv>`_, 963 `@fghzxm <https://github.com/fghzxm>`_, 964 `@refnum <https://github.com/refnum>`_, 965 `@pramodk (Pramod Kumbhar) <https://github.com/pramodk>`_, 966 `@Spirrwell <https://github.com/Spirrwell>`_, 967 `@scramsby (Scott Ramsby) <https://github.com/scramsby>`_. 968 9696.1.2 - 2019-12-11 970------------------ 971 972* Fixed ABI compatibility with ``libfmt.so.6.0.0`` 973 (`#1471 <https://github.com/fmtlib/fmt/issues/1471>`_). 974 975* Fixed handling types convertible to ``std::string_view`` 976 (`#1451 <https://github.com/fmtlib/fmt/pull/1451>`_). 977 Thanks `@denizevrenci (Deniz Evrenci) <https://github.com/denizevrenci>`_. 978 979* Made CUDA test an opt-in enabled via the ``FMT_CUDA_TEST`` CMake option. 980 981* Fixed sign conversion warnings 982 (`#1440 <https://github.com/fmtlib/fmt/pull/1440>`_). 983 Thanks `@0x8000-0000 (Florin Iucha) <https://github.com/0x8000-0000>`_. 984 9856.1.1 - 2019-12-04 986------------------ 987 988* Fixed shared library build on Windows 989 (`#1443 <https://github.com/fmtlib/fmt/pull/1443>`_, 990 `#1445 <https://github.com/fmtlib/fmt/issues/1445>`_, 991 `#1446 <https://github.com/fmtlib/fmt/pull/1446>`_, 992 `#1450 <https://github.com/fmtlib/fmt/issues/1450>`_). 993 Thanks `@egorpugin (Egor Pugin) <https://github.com/egorpugin>`_, 994 `@bbolli (Beat Bolli) <https://github.com/bbolli>`_. 995 996* Added a missing decimal point in exponent notation with trailing zeros. 997 998* Removed deprecated ``format_arg_store::TYPES``. 999 10006.1.0 - 2019-12-01 1001------------------ 1002 1003* {fmt} now formats IEEE 754 ``float`` and ``double`` using the shortest decimal 1004 representation with correct rounding by default: 1005 1006 .. code:: c++ 1007 1008 #include <cmath> 1009 #include <fmt/core.h> 1010 1011 int main() { 1012 fmt::print("{}", M_PI); 1013 } 1014 1015 prints ``3.141592653589793``. 1016 1017* Made the fast binary to decimal floating-point formatter the default, 1018 simplified it and improved performance. {fmt} is now 15 times faster than 1019 libc++'s ``std::ostringstream``, 11 times faster than ``printf`` and 10% 1020 faster than double-conversion on `dtoa-benchmark 1021 <https://github.com/fmtlib/dtoa-benchmark>`_: 1022 1023 ================== ========= ======= 1024 Function Time (ns) Speedup 1025 ================== ========= ======= 1026 ostringstream 1,346.30 1.00x 1027 ostrstream 1,195.74 1.13x 1028 sprintf 995.08 1.35x 1029 doubleconv 99.10 13.59x 1030 fmt 88.34 15.24x 1031 ================== ========= ======= 1032 1033 .. image:: https://user-images.githubusercontent.com/576385/ 1034 69767160-cdaca400-112f-11ea-9fc5-347c9f83caad.png 1035 1036* {fmt} no longer converts ``float`` arguments to ``double``. In particular this 1037 improves the default (shortest) representation of floats and makes 1038 ``fmt::format`` consistent with ``std::format`` specs 1039 (`#1336 <https://github.com/fmtlib/fmt/issues/1336>`_, 1040 `#1353 <https://github.com/fmtlib/fmt/issues/1353>`_, 1041 `#1360 <https://github.com/fmtlib/fmt/pull/1360>`_, 1042 `#1361 <https://github.com/fmtlib/fmt/pull/1361>`_): 1043 1044 .. code:: c++ 1045 1046 fmt::print("{}", 0.1f); 1047 1048 prints ``0.1`` instead of ``0.10000000149011612``. 1049 1050 Thanks `@orivej (Orivej Desh) <https://github.com/orivej>`_. 1051 1052* Made floating-point formatting output consistent with ``printf``/iostreams 1053 (`#1376 <https://github.com/fmtlib/fmt/issues/1376>`_, 1054 `#1417 <https://github.com/fmtlib/fmt/issues/1417>`_). 1055 1056* Added support for 128-bit integers 1057 (`#1287 <https://github.com/fmtlib/fmt/pull/1287>`_): 1058 1059 .. code:: c++ 1060 1061 fmt::print("{}", std::numeric_limits<__int128_t>::max()); 1062 1063 prints ``170141183460469231731687303715884105727``. 1064 1065 Thanks `@denizevrenci (Deniz Evrenci) <https://github.com/denizevrenci>`_. 1066 1067* The overload of ``print`` that takes ``text_style`` is now atomic, i.e. the 1068 output from different threads doesn't interleave 1069 (`#1351 <https://github.com/fmtlib/fmt/pull/1351>`_). 1070 Thanks `@tankiJong (Tanki Zhang) <https://github.com/tankiJong>`_. 1071 1072* Made compile time in the header-only mode ~20% faster by reducing the number 1073 of template instantiations. ``wchar_t`` overload of ``vprint`` was moved from 1074 ``fmt/core.h`` to ``fmt/format.h``. 1075 1076* Added an overload of ``fmt::join`` that works with tuples 1077 (`#1322 <https://github.com/fmtlib/fmt/issues/1322>`_, 1078 `#1330 <https://github.com/fmtlib/fmt/pull/1330>`_): 1079 1080 .. code:: c++ 1081 1082 #include <tuple> 1083 #include <fmt/ranges.h> 1084 1085 int main() { 1086 std::tuple<char, int, float> t{'a', 1, 2.0f}; 1087 fmt::print("{}", t); 1088 } 1089 1090 prints ``('a', 1, 2.0)``. 1091 1092 Thanks `@jeremyong (Jeremy Ong) <https://github.com/jeremyong>`_. 1093 1094* Changed formatting of octal zero with prefix from "00" to "0": 1095 1096 .. code:: c++ 1097 1098 fmt::print("{:#o}", 0); 1099 1100 prints ``0``. 1101 1102* The locale is now passed to ostream insertion (``<<``) operators 1103 (`#1406 <https://github.com/fmtlib/fmt/pull/1406>`_): 1104 1105 .. code:: c++ 1106 1107 #include <fmt/locale.h> 1108 #include <fmt/ostream.h> 1109 1110 struct S { 1111 double value; 1112 }; 1113 1114 std::ostream& operator<<(std::ostream& os, S s) { 1115 return os << s.value; 1116 } 1117 1118 int main() { 1119 auto s = fmt::format(std::locale("fr_FR.UTF-8"), "{}", S{0.42}); 1120 // s == "0,42" 1121 } 1122 1123 Thanks `@dlaugt (Daniel Laügt) <https://github.com/dlaugt>`_. 1124 1125* Locale-specific number formatting now uses grouping 1126 (`#1393 <https://github.com/fmtlib/fmt/issues/1393>`_ 1127 `#1394 <https://github.com/fmtlib/fmt/pull/1394>`_). 1128 Thanks `@skrdaniel <https://github.com/skrdaniel>`_. 1129 1130* Fixed handling of types with deleted implicit rvalue conversion to 1131 ``const char**`` (`#1421 <https://github.com/fmtlib/fmt/issues/1421>`_): 1132 1133 .. code:: c++ 1134 1135 struct mystring { 1136 operator const char*() const&; 1137 operator const char*() &; 1138 operator const char*() const&& = delete; 1139 operator const char*() && = delete; 1140 }; 1141 mystring str; 1142 fmt::print("{}", str); // now compiles 1143 1144* Enums are now mapped to correct underlying types instead of ``int`` 1145 (`#1286 <https://github.com/fmtlib/fmt/pull/1286>`_). 1146 Thanks `@agmt (Egor Seredin) <https://github.com/agmt>`_. 1147 1148* Enum classes are no longer implicitly converted to ``int`` 1149 (`#1424 <https://github.com/fmtlib/fmt/issues/1424>`_). 1150 1151* Added ``basic_format_parse_context`` for consistency with C++20 1152 ``std::format`` and deprecated ``basic_parse_context``. 1153 1154* Fixed handling of UTF-8 in precision 1155 (`#1389 <https://github.com/fmtlib/fmt/issues/1389>`_, 1156 `#1390 <https://github.com/fmtlib/fmt/pull/1390>`_). 1157 Thanks `@tajtiattila (Attila Tajti) <https://github.com/tajtiattila>`_. 1158 1159* {fmt} can now be installed on Linux, macOS and Windows with 1160 `Conda <https://docs.conda.io/en/latest/>`__ using its 1161 `conda-forge <https://conda-forge.org>`__ 1162 `package <https://github.com/conda-forge/fmt-feedstock>`__ 1163 (`#1410 <https://github.com/fmtlib/fmt/pull/1410>`_):: 1164 1165 conda install -c conda-forge fmt 1166 1167 Thanks `@tdegeus (Tom de Geus) <https://github.com/tdegeus>`_. 1168 1169* Added a CUDA test (`#1285 <https://github.com/fmtlib/fmt/pull/1285>`_, 1170 `#1317 <https://github.com/fmtlib/fmt/pull/1317>`_). 1171 Thanks `@luncliff (Park DongHa) <https://github.com/luncliff>`_ and 1172 `@risa2000 <https://github.com/risa2000>`_. 1173 1174* Improved documentation (`#1276 <https://github.com/fmtlib/fmt/pull/1276>`_, 1175 `#1291 <https://github.com/fmtlib/fmt/issues/1291>`_, 1176 `#1296 <https://github.com/fmtlib/fmt/issues/1296>`_, 1177 `#1315 <https://github.com/fmtlib/fmt/pull/1315>`_, 1178 `#1332 <https://github.com/fmtlib/fmt/pull/1332>`_, 1179 `#1337 <https://github.com/fmtlib/fmt/pull/1337>`_, 1180 `#1395 <https://github.com/fmtlib/fmt/issues/1395>`_ 1181 `#1418 <https://github.com/fmtlib/fmt/pull/1418>`_). 1182 Thanks 1183 `@waywardmonkeys (Bruce Mitchener) <https://github.com/waywardmonkeys>`_, 1184 `@pauldreik (Paul Dreik) <https://github.com/pauldreik>`_, 1185 `@jackoalan (Jack Andersen) <https://github.com/jackoalan>`_. 1186 1187* Various code improvements 1188 (`#1358 <https://github.com/fmtlib/fmt/pull/1358>`_, 1189 `#1407 <https://github.com/fmtlib/fmt/pull/1407>`_). 1190 Thanks `@orivej (Orivej Desh) <https://github.com/orivej>`_, 1191 `@dpacbach (David P. Sicilia) <https://github.com/dpacbach>`_, 1192 1193* Fixed compile-time format string checks for user-defined types 1194 (`#1292 <https://github.com/fmtlib/fmt/issues/1292>`_). 1195 1196* Worked around a false positive in ``unsigned-integer-overflow`` sanitizer 1197 (`#1377 <https://github.com/fmtlib/fmt/issues/1377>`_). 1198 1199* Fixed various warnings and compilation issues 1200 (`#1273 <https://github.com/fmtlib/fmt/issues/1273>`_, 1201 `#1278 <https://github.com/fmtlib/fmt/pull/1278>`_, 1202 `#1280 <https://github.com/fmtlib/fmt/pull/1280>`_, 1203 `#1281 <https://github.com/fmtlib/fmt/issues/1281>`_, 1204 `#1288 <https://github.com/fmtlib/fmt/issues/1288>`_, 1205 `#1290 <https://github.com/fmtlib/fmt/pull/1290>`_, 1206 `#1301 <https://github.com/fmtlib/fmt/pull/1301>`_, 1207 `#1305 <https://github.com/fmtlib/fmt/issues/1305>`_, 1208 `#1306 <https://github.com/fmtlib/fmt/issues/1306>`_, 1209 `#1309 <https://github.com/fmtlib/fmt/issues/1309>`_, 1210 `#1312 <https://github.com/fmtlib/fmt/pull/1312>`_, 1211 `#1313 <https://github.com/fmtlib/fmt/issues/1313>`_, 1212 `#1316 <https://github.com/fmtlib/fmt/issues/1316>`_, 1213 `#1319 <https://github.com/fmtlib/fmt/issues/1319>`_, 1214 `#1320 <https://github.com/fmtlib/fmt/pull/1320>`_, 1215 `#1326 <https://github.com/fmtlib/fmt/pull/1326>`_, 1216 `#1328 <https://github.com/fmtlib/fmt/pull/1328>`_, 1217 `#1344 <https://github.com/fmtlib/fmt/issues/1344>`_, 1218 `#1345 <https://github.com/fmtlib/fmt/pull/1345>`_, 1219 `#1347 <https://github.com/fmtlib/fmt/pull/1347>`_, 1220 `#1349 <https://github.com/fmtlib/fmt/pull/1349>`_, 1221 `#1354 <https://github.com/fmtlib/fmt/issues/1354>`_, 1222 `#1362 <https://github.com/fmtlib/fmt/issues/1362>`_, 1223 `#1366 <https://github.com/fmtlib/fmt/issues/1366>`_, 1224 `#1364 <https://github.com/fmtlib/fmt/pull/1364>`_, 1225 `#1370 <https://github.com/fmtlib/fmt/pull/1370>`_, 1226 `#1371 <https://github.com/fmtlib/fmt/pull/1371>`_, 1227 `#1385 <https://github.com/fmtlib/fmt/issues/1385>`_, 1228 `#1388 <https://github.com/fmtlib/fmt/issues/1388>`_, 1229 `#1397 <https://github.com/fmtlib/fmt/pull/1397>`_, 1230 `#1414 <https://github.com/fmtlib/fmt/pull/1414>`_, 1231 `#1416 <https://github.com/fmtlib/fmt/pull/1416>`_, 1232 `#1422 <https://github.com/fmtlib/fmt/issues/1422>`_ 1233 `#1427 <https://github.com/fmtlib/fmt/pull/1427>`_, 1234 `#1431 <https://github.com/fmtlib/fmt/issues/1431>`_, 1235 `#1433 <https://github.com/fmtlib/fmt/pull/1433>`_). 1236 Thanks `@hhb <https://github.com/hhb>`_, 1237 `@gsjaardema (Greg Sjaardema) <https://github.com/gsjaardema>`_, 1238 `@gabime (Gabi Melman) <https://github.com/gabime>`_, 1239 `@neheb (Rosen Penev) <https://github.com/neheb>`_, 1240 `@vedranmiletic (Vedran Miletić) <https://github.com/vedranmiletic>`_, 1241 `@dkavolis (Daumantas Kavolis) <https://github.com/dkavolis>`_, 1242 `@mwinterb <https://github.com/mwinterb>`_, 1243 `@orivej (Orivej Desh) <https://github.com/orivej>`_, 1244 `@denizevrenci (Deniz Evrenci) <https://github.com/denizevrenci>`_ 1245 `@leonklingele <https://github.com/leonklingele>`_, 1246 `@chronoxor (Ivan Shynkarenka) <https://github.com/chronoxor>`_, 1247 `@kent-tri <https://github.com/kent-tri>`_, 1248 `@0x8000-0000 (Florin Iucha) <https://github.com/0x8000-0000>`_, 1249 `@marti4d (Chris Martin) <https://github.com/marti4d>`_. 1250 12516.0.0 - 2019-08-26 1252------------------ 1253 1254* Switched to the `MIT license 1255 <https://github.com/fmtlib/fmt/blob/5a4b24613ba16cc689977c3b5bd8274a3ba1dd1f/LICENSE.rst>`_ 1256 with an optional exception that allows distributing binary code without 1257 attribution. 1258 1259* Floating-point formatting is now locale-independent by default: 1260 1261 .. code:: c++ 1262 1263 #include <locale> 1264 #include <fmt/core.h> 1265 1266 int main() { 1267 std::locale::global(std::locale("ru_RU.UTF-8")); 1268 fmt::print("value = {}", 4.2); 1269 } 1270 1271 prints "value = 4.2" regardless of the locale. 1272 1273 For locale-specific formatting use the ``n`` specifier: 1274 1275 .. code:: c++ 1276 1277 std::locale::global(std::locale("ru_RU.UTF-8")); 1278 fmt::print("value = {:n}", 4.2); 1279 1280 prints "value = 4,2". 1281 1282* Added an experimental Grisu floating-point formatting algorithm 1283 implementation (disabled by default). To enable it compile with the 1284 ``FMT_USE_GRISU`` macro defined to 1: 1285 1286 .. code:: c++ 1287 1288 #define FMT_USE_GRISU 1 1289 #include <fmt/format.h> 1290 1291 auto s = fmt::format("{}", 4.2); // formats 4.2 using Grisu 1292 1293 With Grisu enabled, {fmt} is 13x faster than ``std::ostringstream`` (libc++) 1294 and 10x faster than ``sprintf`` on `dtoa-benchmark 1295 <https://github.com/fmtlib/dtoa-benchmark>`_ (`full results 1296 <https://fmt.dev/unknown_mac64_clang10.0.html>`_): 1297 1298 .. image:: https://user-images.githubusercontent.com/576385/ 1299 54883977-9fe8c000-4e28-11e9-8bde-272d122e7c52.jpg 1300 1301* Separated formatting and parsing contexts for consistency with 1302 `C++20 std::format <http://eel.is/c++draft/format>`_, removing the 1303 undocumented ``basic_format_context::parse_context()`` function. 1304 1305* Added `oss-fuzz <https://github.com/google/oss-fuzz>`_ support 1306 (`#1199 <https://github.com/fmtlib/fmt/pull/1199>`_). 1307 Thanks `@pauldreik (Paul Dreik) <https://github.com/pauldreik>`_. 1308 1309* ``formatter`` specializations now always take precedence over ``operator<<`` 1310 (`#952 <https://github.com/fmtlib/fmt/issues/952>`_): 1311 1312 .. code:: c++ 1313 1314 #include <iostream> 1315 #include <fmt/ostream.h> 1316 1317 struct S {}; 1318 1319 std::ostream& operator<<(std::ostream& os, S) { 1320 return os << 1; 1321 } 1322 1323 template <> 1324 struct fmt::formatter<S> : fmt::formatter<int> { 1325 auto format(S, format_context& ctx) { 1326 return formatter<int>::format(2, ctx); 1327 } 1328 }; 1329 1330 int main() { 1331 std::cout << S() << "\n"; // prints 1 using operator<< 1332 fmt::print("{}\n", S()); // prints 2 using formatter 1333 } 1334 1335* Introduced the experimental ``fmt::compile`` function that does format string 1336 compilation (`#618 <https://github.com/fmtlib/fmt/issues/618>`_, 1337 `#1169 <https://github.com/fmtlib/fmt/issues/1169>`_, 1338 `#1171 <https://github.com/fmtlib/fmt/pull/1171>`_): 1339 1340 .. code:: c++ 1341 1342 #include <fmt/compile.h> 1343 1344 auto f = fmt::compile<int>("{}"); 1345 std::string s = fmt::format(f, 42); // can be called multiple times to 1346 // format different values 1347 // s == "42" 1348 1349 It moves the cost of parsing a format string outside of the format function 1350 which can be beneficial when identically formatting many objects of the same 1351 types. Thanks `@stryku (Mateusz Janek) <https://github.com/stryku>`_. 1352 1353* Added experimental ``%`` format specifier that formats floating-point values 1354 as percentages (`#1060 <https://github.com/fmtlib/fmt/pull/1060>`_, 1355 `#1069 <https://github.com/fmtlib/fmt/pull/1069>`_, 1356 `#1071 <https://github.com/fmtlib/fmt/pull/1071>`_): 1357 1358 .. code:: c++ 1359 1360 auto s = fmt::format("{:.1%}", 0.42); // s == "42.0%" 1361 1362 Thanks `@gawain-bolton (Gawain Bolton) <https://github.com/gawain-bolton>`_. 1363 1364* Implemented precision for floating-point durations 1365 (`#1004 <https://github.com/fmtlib/fmt/issues/1004>`_, 1366 `#1012 <https://github.com/fmtlib/fmt/pull/1012>`_): 1367 1368 .. code:: c++ 1369 1370 auto s = fmt::format("{:.1}", std::chrono::duration<double>(1.234)); 1371 // s == 1.2s 1372 1373 Thanks `@DanielaE (Daniela Engert) <https://github.com/DanielaE>`_. 1374 1375* Implemented ``chrono`` format specifiers ``%Q`` and ``%q`` that give the value 1376 and the unit respectively (`#1019 <https://github.com/fmtlib/fmt/pull/1019>`_): 1377 1378 .. code:: c++ 1379 1380 auto value = fmt::format("{:%Q}", 42s); // value == "42" 1381 auto unit = fmt::format("{:%q}", 42s); // unit == "s" 1382 1383 Thanks `@DanielaE (Daniela Engert) <https://github.com/DanielaE>`_. 1384 1385* Fixed handling of dynamic width in chrono formatter: 1386 1387 .. code:: c++ 1388 1389 auto s = fmt::format("{0:{1}%H:%M:%S}", std::chrono::seconds(12345), 12); 1390 // ^ width argument index ^ width 1391 // s == "03:25:45 " 1392 1393 Thanks Howard Hinnant. 1394 1395* Removed deprecated ``fmt/time.h``. Use ``fmt/chrono.h`` instead. 1396 1397* Added ``fmt::format`` and ``fmt::vformat`` overloads that take ``text_style`` 1398 (`#993 <https://github.com/fmtlib/fmt/issues/993>`_, 1399 `#994 <https://github.com/fmtlib/fmt/pull/994>`_): 1400 1401 .. code:: c++ 1402 1403 #include <fmt/color.h> 1404 1405 std::string message = fmt::format(fmt::emphasis::bold | fg(fmt::color::red), 1406 "The answer is {}.", 42); 1407 1408 Thanks `@Naios (Denis Blank) <https://github.com/Naios>`_. 1409 1410* Removed the deprecated color API (``print_colored``). Use the new API, namely 1411 ``print`` overloads that take ``text_style`` instead. 1412 1413* Made ``std::unique_ptr`` and ``std::shared_ptr`` formattable as pointers via 1414 ``fmt::ptr`` (`#1121 <https://github.com/fmtlib/fmt/pull/1121>`_): 1415 1416 .. code:: c++ 1417 1418 std::unique_ptr<int> p = ...; 1419 fmt::print("{}", fmt::ptr(p)); // prints p as a pointer 1420 1421 Thanks `@sighingnow (Tao He) <https://github.com/sighingnow>`_. 1422 1423* Made ``print`` and ``vprint`` report I/O errors 1424 (`#1098 <https://github.com/fmtlib/fmt/issues/1098>`_, 1425 `#1099 <https://github.com/fmtlib/fmt/pull/1099>`_). 1426 Thanks `@BillyDonahue (Billy Donahue) <https://github.com/BillyDonahue>`_. 1427 1428* Marked deprecated APIs with the ``[[deprecated]]`` attribute and removed 1429 internal uses of deprecated APIs 1430 (`#1022 <https://github.com/fmtlib/fmt/pull/1022>`_). 1431 Thanks `@eliaskosunen (Elias Kosunen) <https://github.com/eliaskosunen>`_. 1432 1433* Modernized the codebase using more C++11 features and removing workarounds. 1434 Most importantly, ``buffer_context`` is now an alias template, so 1435 use ``buffer_context<T>`` instead of ``buffer_context<T>::type``. 1436 These features require GCC 4.8 or later. 1437 1438* ``formatter`` specializations now always take precedence over implicit 1439 conversions to ``int`` and the undocumented ``convert_to_int`` trait 1440 is now deprecated. 1441 1442* Moved the undocumented ``basic_writer``, ``writer``, and ``wwriter`` types 1443 to the ``internal`` namespace. 1444 1445* Removed deprecated ``basic_format_context::begin()``. Use ``out()`` instead. 1446 1447* Disallowed passing the result of ``join`` as an lvalue to prevent misuse. 1448 1449* Refactored the undocumented structs that represent parsed format specifiers 1450 to simplify the API and allow multibyte fill. 1451 1452* Moved SFINAE to template parameters to reduce symbol sizes. 1453 1454* Switched to ``fputws`` for writing wide strings so that it's no longer 1455 required to call ``_setmode`` on Windows 1456 (`#1229 <https://github.com/fmtlib/fmt/issues/1229>`_, 1457 `#1243 <https://github.com/fmtlib/fmt/pull/1243>`_). 1458 Thanks `@jackoalan (Jack Andersen) <https://github.com/jackoalan>`_. 1459 1460* Improved literal-based API 1461 (`#1254 <https://github.com/fmtlib/fmt/pull/1254>`_). 1462 Thanks `@sylveon (Charles Milette) <https://github.com/sylveon>`_. 1463 1464* Added support for exotic platforms without ``uintptr_t`` such as IBM i 1465 (AS/400) which has 128-bit pointers and only 64-bit integers 1466 (`#1059 <https://github.com/fmtlib/fmt/issues/1059>`_). 1467 1468* Added `Sublime Text syntax highlighting config 1469 <https://github.com/fmtlib/fmt/blob/master/support/C%2B%2B.sublime-syntax>`_ 1470 (`#1037 <https://github.com/fmtlib/fmt/issues/1037>`_). 1471 Thanks `@Kronuz (Germán Méndez Bravo) <https://github.com/Kronuz>`_. 1472 1473* Added the ``FMT_ENFORCE_COMPILE_STRING`` macro to enforce the use of 1474 compile-time format strings 1475 (`#1231 <https://github.com/fmtlib/fmt/pull/1231>`_). 1476 Thanks `@jackoalan (Jack Andersen) <https://github.com/jackoalan>`_. 1477 1478* Stopped setting ``CMAKE_BUILD_TYPE`` if {fmt} is a subproject 1479 (`#1081 <https://github.com/fmtlib/fmt/issues/1081>`_). 1480 1481* Various build improvements 1482 (`#1039 <https://github.com/fmtlib/fmt/pull/1039>`_, 1483 `#1078 <https://github.com/fmtlib/fmt/pull/1078>`_, 1484 `#1091 <https://github.com/fmtlib/fmt/pull/1091>`_, 1485 `#1103 <https://github.com/fmtlib/fmt/pull/1103>`_, 1486 `#1177 <https://github.com/fmtlib/fmt/pull/1177>`_). 1487 Thanks `@luncliff (Park DongHa) <https://github.com/luncliff>`_, 1488 `@jasonszang (Jason Shuo Zang) <https://github.com/jasonszang>`_, 1489 `@olafhering (Olaf Hering) <https://github.com/olafhering>`_, 1490 `@Lecetem <https://github.com/Lectem>`_, 1491 `@pauldreik (Paul Dreik) <https://github.com/pauldreik>`_. 1492 1493* Improved documentation 1494 (`#1049 <https://github.com/fmtlib/fmt/issues/1049>`_, 1495 `#1051 <https://github.com/fmtlib/fmt/pull/1051>`_, 1496 `#1083 <https://github.com/fmtlib/fmt/pull/1083>`_, 1497 `#1113 <https://github.com/fmtlib/fmt/pull/1113>`_, 1498 `#1114 <https://github.com/fmtlib/fmt/pull/1114>`_, 1499 `#1146 <https://github.com/fmtlib/fmt/issues/1146>`_, 1500 `#1180 <https://github.com/fmtlib/fmt/issues/1180>`_, 1501 `#1250 <https://github.com/fmtlib/fmt/pull/1250>`_, 1502 `#1252 <https://github.com/fmtlib/fmt/pull/1252>`_, 1503 `#1265 <https://github.com/fmtlib/fmt/pull/1265>`_). 1504 Thanks `@mikelui (Michael Lui) <https://github.com/mikelui>`_, 1505 `@foonathan (Jonathan Müller) <https://github.com/foonathan>`_, 1506 `@BillyDonahue (Billy Donahue) <https://github.com/BillyDonahue>`_, 1507 `@jwakely (Jonathan Wakely) <https://github.com/jwakely>`_, 1508 `@kaisbe (Kais Ben Salah) <https://github.com/kaisbe>`_, 1509 `@sdebionne (Samuel Debionne) <https://github.com/sdebionne>`_. 1510 1511* Fixed ambiguous formatter specialization in ``fmt/ranges.h`` 1512 (`#1123 <https://github.com/fmtlib/fmt/issues/1123>`_). 1513 1514* Fixed formatting of a non-empty ``std::filesystem::path`` which is an 1515 infinitely deep range of its components 1516 (`#1268 <https://github.com/fmtlib/fmt/issues/1268>`_). 1517 1518* Fixed handling of general output iterators when formatting characters 1519 (`#1056 <https://github.com/fmtlib/fmt/issues/1056>`_, 1520 `#1058 <https://github.com/fmtlib/fmt/pull/1058>`_). 1521 Thanks `@abolz (Alexander Bolz) <https://github.com/abolz>`_. 1522 1523* Fixed handling of output iterators in ``formatter`` specialization for 1524 ranges (`#1064 <https://github.com/fmtlib/fmt/issues/1064>`_). 1525 1526* Fixed handling of exotic character types 1527 (`#1188 <https://github.com/fmtlib/fmt/issues/1188>`_). 1528 1529* Made chrono formatting work with exceptions disabled 1530 (`#1062 <https://github.com/fmtlib/fmt/issues/1062>`_). 1531 1532* Fixed DLL visibility issues 1533 (`#1134 <https://github.com/fmtlib/fmt/pull/1134>`_, 1534 `#1147 <https://github.com/fmtlib/fmt/pull/1147>`_). 1535 Thanks `@denchat <https://github.com/denchat>`_. 1536 1537* Disabled the use of UDL template extension on GCC 9 1538 (`#1148 <https://github.com/fmtlib/fmt/issues/1148>`_). 1539 1540* Removed misplaced ``format`` compile-time checks from ``printf`` 1541 (`#1173 <https://github.com/fmtlib/fmt/issues/1173>`_). 1542 1543* Fixed issues in the experimental floating-point formatter 1544 (`#1072 <https://github.com/fmtlib/fmt/issues/1072>`_, 1545 `#1129 <https://github.com/fmtlib/fmt/issues/1129>`_, 1546 `#1153 <https://github.com/fmtlib/fmt/issues/1153>`_, 1547 `#1155 <https://github.com/fmtlib/fmt/pull/1155>`_, 1548 `#1210 <https://github.com/fmtlib/fmt/issues/1210>`_, 1549 `#1222 <https://github.com/fmtlib/fmt/issues/1222>`_). 1550 Thanks `@alabuzhev (Alex Alabuzhev) <https://github.com/alabuzhev>`_. 1551 1552* Fixed bugs discovered by fuzzing or during fuzzing integration 1553 (`#1124 <https://github.com/fmtlib/fmt/issues/1124>`_, 1554 `#1127 <https://github.com/fmtlib/fmt/issues/1127>`_, 1555 `#1132 <https://github.com/fmtlib/fmt/issues/1132>`_, 1556 `#1135 <https://github.com/fmtlib/fmt/pull/1135>`_, 1557 `#1136 <https://github.com/fmtlib/fmt/issues/1136>`_, 1558 `#1141 <https://github.com/fmtlib/fmt/issues/1141>`_, 1559 `#1142 <https://github.com/fmtlib/fmt/issues/1142>`_, 1560 `#1178 <https://github.com/fmtlib/fmt/issues/1178>`_, 1561 `#1179 <https://github.com/fmtlib/fmt/issues/1179>`_, 1562 `#1194 <https://github.com/fmtlib/fmt/issues/1194>`_). 1563 Thanks `@pauldreik (Paul Dreik) <https://github.com/pauldreik>`_. 1564 1565* Fixed building tests on FreeBSD and Hurd 1566 (`#1043 <https://github.com/fmtlib/fmt/issues/1043>`_). 1567 Thanks `@jackyf (Eugene V. Lyubimkin) <https://github.com/jackyf>`_. 1568 1569* Fixed various warnings and compilation issues 1570 (`#998 <https://github.com/fmtlib/fmt/pull/998>`_, 1571 `#1006 <https://github.com/fmtlib/fmt/pull/1006>`_, 1572 `#1008 <https://github.com/fmtlib/fmt/issues/1008>`_, 1573 `#1011 <https://github.com/fmtlib/fmt/issues/1011>`_, 1574 `#1025 <https://github.com/fmtlib/fmt/issues/1025>`_, 1575 `#1027 <https://github.com/fmtlib/fmt/pull/1027>`_, 1576 `#1028 <https://github.com/fmtlib/fmt/pull/1028>`_, 1577 `#1029 <https://github.com/fmtlib/fmt/pull/1029>`_, 1578 `#1030 <https://github.com/fmtlib/fmt/pull/1030>`_, 1579 `#1031 <https://github.com/fmtlib/fmt/pull/1031>`_, 1580 `#1054 <https://github.com/fmtlib/fmt/pull/1054>`_, 1581 `#1063 <https://github.com/fmtlib/fmt/issues/1063>`_, 1582 `#1068 <https://github.com/fmtlib/fmt/pull/1068>`_, 1583 `#1074 <https://github.com/fmtlib/fmt/pull/1074>`_, 1584 `#1075 <https://github.com/fmtlib/fmt/pull/1075>`_, 1585 `#1079 <https://github.com/fmtlib/fmt/pull/1079>`_, 1586 `#1086 <https://github.com/fmtlib/fmt/pull/1086>`_, 1587 `#1088 <https://github.com/fmtlib/fmt/issues/1088>`_, 1588 `#1089 <https://github.com/fmtlib/fmt/pull/1089>`_, 1589 `#1094 <https://github.com/fmtlib/fmt/pull/1094>`_, 1590 `#1101 <https://github.com/fmtlib/fmt/issues/1101>`_, 1591 `#1102 <https://github.com/fmtlib/fmt/pull/1102>`_, 1592 `#1105 <https://github.com/fmtlib/fmt/issues/1105>`_, 1593 `#1107 <https://github.com/fmtlib/fmt/pull/1107>`_, 1594 `#1115 <https://github.com/fmtlib/fmt/issues/1115>`_, 1595 `#1117 <https://github.com/fmtlib/fmt/issues/1117>`_, 1596 `#1118 <https://github.com/fmtlib/fmt/issues/1118>`_, 1597 `#1120 <https://github.com/fmtlib/fmt/issues/1120>`_, 1598 `#1123 <https://github.com/fmtlib/fmt/issues/1123>`_, 1599 `#1139 <https://github.com/fmtlib/fmt/pull/1139>`_, 1600 `#1140 <https://github.com/fmtlib/fmt/issues/1140>`_, 1601 `#1143 <https://github.com/fmtlib/fmt/issues/1143>`_, 1602 `#1144 <https://github.com/fmtlib/fmt/pull/1144>`_, 1603 `#1150 <https://github.com/fmtlib/fmt/pull/1150>`_, 1604 `#1151 <https://github.com/fmtlib/fmt/pull/1151>`_, 1605 `#1152 <https://github.com/fmtlib/fmt/issues/1152>`_, 1606 `#1154 <https://github.com/fmtlib/fmt/issues/1154>`_, 1607 `#1156 <https://github.com/fmtlib/fmt/issues/1156>`_, 1608 `#1159 <https://github.com/fmtlib/fmt/pull/1159>`_, 1609 `#1175 <https://github.com/fmtlib/fmt/issues/1175>`_, 1610 `#1181 <https://github.com/fmtlib/fmt/issues/1181>`_, 1611 `#1186 <https://github.com/fmtlib/fmt/issues/1186>`_, 1612 `#1187 <https://github.com/fmtlib/fmt/pull/1187>`_, 1613 `#1191 <https://github.com/fmtlib/fmt/pull/1191>`_, 1614 `#1197 <https://github.com/fmtlib/fmt/issues/1197>`_, 1615 `#1200 <https://github.com/fmtlib/fmt/issues/1200>`_, 1616 `#1203 <https://github.com/fmtlib/fmt/issues/1203>`_, 1617 `#1205 <https://github.com/fmtlib/fmt/issues/1205>`_, 1618 `#1206 <https://github.com/fmtlib/fmt/pull/1206>`_, 1619 `#1213 <https://github.com/fmtlib/fmt/issues/1213>`_, 1620 `#1214 <https://github.com/fmtlib/fmt/issues/1214>`_, 1621 `#1217 <https://github.com/fmtlib/fmt/pull/1217>`_, 1622 `#1228 <https://github.com/fmtlib/fmt/issues/1228>`_, 1623 `#1230 <https://github.com/fmtlib/fmt/pull/1230>`_, 1624 `#1232 <https://github.com/fmtlib/fmt/issues/1232>`_, 1625 `#1235 <https://github.com/fmtlib/fmt/pull/1235>`_, 1626 `#1236 <https://github.com/fmtlib/fmt/pull/1236>`_, 1627 `#1240 <https://github.com/fmtlib/fmt/issues/1240>`_). 1628 Thanks `@DanielaE (Daniela Engert) <https://github.com/DanielaE>`_, 1629 `@mwinterb <https://github.com/mwinterb>`_, 1630 `@eliaskosunen (Elias Kosunen) <https://github.com/eliaskosunen>`_, 1631 `@morinmorin <https://github.com/morinmorin>`_, 1632 `@ricco19 (Brian Ricciardelli) <https://github.com/ricco19>`_, 1633 `@waywardmonkeys (Bruce Mitchener) <https://github.com/waywardmonkeys>`_, 1634 `@chronoxor (Ivan Shynkarenka) <https://github.com/chronoxor>`_, 1635 `@remyabel <https://github.com/remyabel>`_, 1636 `@pauldreik (Paul Dreik) <https://github.com/pauldreik>`_, 1637 `@gsjaardema (Greg Sjaardema) <https://github.com/gsjaardema>`_, 1638 `@rcane (Ronny Krüger) <https://github.com/rcane>`_, 1639 `@mocabe <https://github.com/mocabe>`_, 1640 `@denchat <https://github.com/denchat>`_, 1641 `@cjdb (Christopher Di Bella) <https://github.com/cjdb>`_, 1642 `@HazardyKnusperkeks (Björn Schäpers) <https://github.com/HazardyKnusperkeks>`_, 1643 `@vedranmiletic (Vedran Miletić) <https://github.com/vedranmiletic>`_, 1644 `@jackoalan (Jack Andersen) <https://github.com/jackoalan>`_, 1645 `@DaanDeMeyer (Daan De Meyer) <https://github.com/DaanDeMeyer>`_, 1646 `@starkmapper (Mark Stapper) <https://github.com/starkmapper>`_. 1647 16485.3.0 - 2018-12-28 1649------------------ 1650 1651* Introduced experimental chrono formatting support: 1652 1653 .. code:: c++ 1654 1655 #include <fmt/chrono.h> 1656 1657 int main() { 1658 using namespace std::literals::chrono_literals; 1659 fmt::print("Default format: {} {}\n", 42s, 100ms); 1660 fmt::print("strftime-like format: {:%H:%M:%S}\n", 3h + 15min + 30s); 1661 } 1662 1663 prints:: 1664 1665 Default format: 42s 100ms 1666 strftime-like format: 03:15:30 1667 1668* Added experimental support for emphasis (bold, italic, underline, 1669 strikethrough), colored output to a file stream, and improved colored 1670 formatting API 1671 (`#961 <https://github.com/fmtlib/fmt/pull/961>`_, 1672 `#967 <https://github.com/fmtlib/fmt/pull/967>`_, 1673 `#973 <https://github.com/fmtlib/fmt/pull/973>`_): 1674 1675 .. code:: c++ 1676 1677 #include <fmt/color.h> 1678 1679 int main() { 1680 print(fg(fmt::color::crimson) | fmt::emphasis::bold, 1681 "Hello, {}!\n", "world"); 1682 print(fg(fmt::color::floral_white) | bg(fmt::color::slate_gray) | 1683 fmt::emphasis::underline, "Hello, {}!\n", "мир"); 1684 print(fg(fmt::color::steel_blue) | fmt::emphasis::italic, 1685 "Hello, {}!\n", "世界"); 1686 } 1687 1688 prints the following on modern terminals with RGB color support: 1689 1690 .. image:: https://user-images.githubusercontent.com/576385/ 1691 50405788-b66e7500-076e-11e9-9592-7324d1f951d8.png 1692 1693 Thanks `@Rakete1111 (Nicolas) <https://github.com/Rakete1111>`_. 1694 1695* Added support for 4-bit terminal colors 1696 (`#968 <https://github.com/fmtlib/fmt/issues/968>`_, 1697 `#974 <https://github.com/fmtlib/fmt/pull/974>`_) 1698 1699 .. code:: c++ 1700 1701 #include <fmt/color.h> 1702 1703 int main() { 1704 print(fg(fmt::terminal_color::red), "stop\n"); 1705 } 1706 1707 Note that these colors vary by terminal: 1708 1709 .. image:: https://user-images.githubusercontent.com/576385/ 1710 50405925-dbfc7e00-0770-11e9-9b85-333fab0af9ac.png 1711 1712 Thanks `@Rakete1111 (Nicolas) <https://github.com/Rakete1111>`_. 1713 1714* Parameterized formatting functions on the type of the format string 1715 (`#880 <https://github.com/fmtlib/fmt/issues/880>`_, 1716 `#881 <https://github.com/fmtlib/fmt/pull/881>`_, 1717 `#883 <https://github.com/fmtlib/fmt/pull/883>`_, 1718 `#885 <https://github.com/fmtlib/fmt/pull/885>`_, 1719 `#897 <https://github.com/fmtlib/fmt/pull/897>`_, 1720 `#920 <https://github.com/fmtlib/fmt/issues/920>`_). 1721 Any object of type ``S`` that has an overloaded ``to_string_view(const S&)`` 1722 returning ``fmt::string_view`` can be used as a format string: 1723 1724 .. code:: c++ 1725 1726 namespace my_ns { 1727 inline string_view to_string_view(const my_string& s) { 1728 return {s.data(), s.length()}; 1729 } 1730 } 1731 1732 std::string message = fmt::format(my_string("The answer is {}."), 42); 1733 1734 Thanks `@DanielaE (Daniela Engert) <https://github.com/DanielaE>`_. 1735 1736* Made ``std::string_view`` work as a format string 1737 (`#898 <https://github.com/fmtlib/fmt/pull/898>`_): 1738 1739 .. code:: c++ 1740 1741 auto message = fmt::format(std::string_view("The answer is {}."), 42); 1742 1743 Thanks `@DanielaE (Daniela Engert) <https://github.com/DanielaE>`_. 1744 1745* Added wide string support to compile-time format string checks 1746 (`#924 <https://github.com/fmtlib/fmt/pull/924>`_): 1747 1748 .. code:: c++ 1749 1750 print(fmt(L"{:f}"), 42); // compile-time error: invalid type specifier 1751 1752 Thanks `@XZiar <https://github.com/XZiar>`_. 1753 1754* Made colored print functions work with wide strings 1755 (`#867 <https://github.com/fmtlib/fmt/pull/867>`_): 1756 1757 .. code:: c++ 1758 1759 #include <fmt/color.h> 1760 1761 int main() { 1762 print(fg(fmt::color::red), L"{}\n", 42); 1763 } 1764 1765 Thanks `@DanielaE (Daniela Engert) <https://github.com/DanielaE>`_. 1766 1767* Introduced experimental Unicode support 1768 (`#628 <https://github.com/fmtlib/fmt/issues/628>`_, 1769 `#891 <https://github.com/fmtlib/fmt/pull/891>`_): 1770 1771 .. code:: c++ 1772 1773 using namespace fmt::literals; 1774 auto s = fmt::format("{:*^5}"_u, ""_u); // s == "****"_u 1775 1776* Improved locale support: 1777 1778 .. code:: c++ 1779 1780 #include <fmt/locale.h> 1781 1782 struct numpunct : std::numpunct<char> { 1783 protected: 1784 char do_thousands_sep() const override { return '~'; } 1785 }; 1786 1787 std::locale loc; 1788 auto s = fmt::format(std::locale(loc, new numpunct()), "{:n}", 1234567); 1789 // s == "1~234~567" 1790 1791* Constrained formatting functions on proper iterator types 1792 (`#921 <https://github.com/fmtlib/fmt/pull/921>`_). 1793 Thanks `@DanielaE (Daniela Engert) <https://github.com/DanielaE>`_. 1794 1795* Added ``make_printf_args`` and ``make_wprintf_args`` functions 1796 (`#934 <https://github.com/fmtlib/fmt/pull/934>`_). 1797 Thanks `@tnovotny <https://github.com/tnovotny>`_. 1798 1799* Deprecated ``fmt::visit``, ``parse_context``, and ``wparse_context``. 1800 Use ``fmt::visit_format_arg``, ``format_parse_context``, and 1801 ``wformat_parse_context`` instead. 1802 1803* Removed undocumented ``basic_fixed_buffer`` which has been superseded by the 1804 iterator-based API 1805 (`#873 <https://github.com/fmtlib/fmt/issues/873>`_, 1806 `#902 <https://github.com/fmtlib/fmt/pull/902>`_). 1807 Thanks `@superfunc (hollywood programmer) <https://github.com/superfunc>`_. 1808 1809* Disallowed repeated leading zeros in an argument ID: 1810 1811 .. code:: c++ 1812 1813 fmt::print("{000}", 42); // error 1814 1815* Reintroduced support for gcc 4.4. 1816 1817* Fixed compilation on platforms with exotic ``double`` 1818 (`#878 <https://github.com/fmtlib/fmt/issues/878>`_). 1819 1820* Improved documentation 1821 (`#164 <https://github.com/fmtlib/fmt/issues/164>`_, 1822 `#877 <https://github.com/fmtlib/fmt/issues/877>`_, 1823 `#901 <https://github.com/fmtlib/fmt/pull/901>`_, 1824 `#906 <https://github.com/fmtlib/fmt/pull/906>`_, 1825 `#979 <https://github.com/fmtlib/fmt/pull/979>`_). 1826 Thanks `@kookjr (Mathew Cucuzella) <https://github.com/kookjr>`_, 1827 `@DarkDimius (Dmitry Petrashko) <https://github.com/DarkDimius>`_, 1828 `@HecticSerenity <https://github.com/HecticSerenity>`_. 1829 1830* Added pkgconfig support which makes it easier to consume the library from 1831 meson and other build systems 1832 (`#916 <https://github.com/fmtlib/fmt/pull/916>`_). 1833 Thanks `@colemickens (Cole Mickens) <https://github.com/colemickens>`_. 1834 1835* Various build improvements 1836 (`#909 <https://github.com/fmtlib/fmt/pull/909>`_, 1837 `#926 <https://github.com/fmtlib/fmt/pull/926>`_, 1838 `#937 <https://github.com/fmtlib/fmt/pull/937>`_, 1839 `#953 <https://github.com/fmtlib/fmt/pull/953>`_, 1840 `#959 <https://github.com/fmtlib/fmt/pull/959>`_). 1841 Thanks `@tchaikov (Kefu Chai) <https://github.com/tchaikov>`_, 1842 `@luncliff (Park DongHa) <https://github.com/luncliff>`_, 1843 `@AndreasSchoenle (Andreas Schönle) <https://github.com/AndreasSchoenle>`_, 1844 `@hotwatermorning <https://github.com/hotwatermorning>`_, 1845 `@Zefz (JohanJansen) <https://github.com/Zefz>`_. 1846 1847* Improved ``string_view`` construction performance 1848 (`#914 <https://github.com/fmtlib/fmt/pull/914>`_). 1849 Thanks `@gabime (Gabi Melman) <https://github.com/gabime>`_. 1850 1851* Fixed non-matching char types 1852 (`#895 <https://github.com/fmtlib/fmt/pull/895>`_). 1853 Thanks `@DanielaE (Daniela Engert) <https://github.com/DanielaE>`_. 1854 1855* Fixed ``format_to_n`` with ``std::back_insert_iterator`` 1856 (`#913 <https://github.com/fmtlib/fmt/pull/913>`_). 1857 Thanks `@DanielaE (Daniela Engert) <https://github.com/DanielaE>`_. 1858 1859* Fixed locale-dependent formatting 1860 (`#905 <https://github.com/fmtlib/fmt/issues/905>`_). 1861 1862* Fixed various compiler warnings and errors 1863 (`#882 <https://github.com/fmtlib/fmt/pull/882>`_, 1864 `#886 <https://github.com/fmtlib/fmt/pull/886>`_, 1865 `#933 <https://github.com/fmtlib/fmt/pull/933>`_, 1866 `#941 <https://github.com/fmtlib/fmt/pull/941>`_, 1867 `#931 <https://github.com/fmtlib/fmt/issues/931>`_, 1868 `#943 <https://github.com/fmtlib/fmt/pull/943>`_, 1869 `#954 <https://github.com/fmtlib/fmt/pull/954>`_, 1870 `#956 <https://github.com/fmtlib/fmt/pull/956>`_, 1871 `#962 <https://github.com/fmtlib/fmt/pull/962>`_, 1872 `#965 <https://github.com/fmtlib/fmt/issues/965>`_, 1873 `#977 <https://github.com/fmtlib/fmt/issues/977>`_, 1874 `#983 <https://github.com/fmtlib/fmt/pull/983>`_, 1875 `#989 <https://github.com/fmtlib/fmt/pull/989>`_). 1876 Thanks `@Luthaf (Guillaume Fraux) <https://github.com/Luthaf>`_, 1877 `@stevenhoving (Steven Hoving) <https://github.com/stevenhoving>`_, 1878 `@christinaa (Kristina Brooks) <https://github.com/christinaa>`_, 1879 `@lgritz (Larry Gritz) <https://github.com/lgritz>`_, 1880 `@DanielaE (Daniela Engert) <https://github.com/DanielaE>`_, 1881 `@0x8000-0000 (Sign Bit) <https://github.com/0x8000-0000>`_, 1882 `@liuping1997 <https://github.com/liuping1997>`_. 1883 18845.2.1 - 2018-09-21 1885------------------ 1886 1887* Fixed ``visit`` lookup issues on gcc 7 & 8 1888 (`#870 <https://github.com/fmtlib/fmt/pull/870>`_). 1889 Thanks `@medithe <https://github.com/medithe>`_. 1890 1891* Fixed linkage errors on older gcc. 1892 1893* Prevented ``fmt/range.h`` from specializing ``fmt::basic_string_view`` 1894 (`#865 <https://github.com/fmtlib/fmt/issues/865>`_, 1895 `#868 <https://github.com/fmtlib/fmt/pull/868>`_). 1896 Thanks `@hhggit (dual) <https://github.com/hhggit>`_. 1897 1898* Improved error message when formatting unknown types 1899 (`#872 <https://github.com/fmtlib/fmt/pull/872>`_). 1900 Thanks `@foonathan (Jonathan Müller) <https://github.com/foonathan>`_, 1901 1902* Disabled templated user-defined literals when compiled under nvcc 1903 (`#875 <https://github.com/fmtlib/fmt/pull/875>`_). 1904 Thanks `@CandyGumdrop (Candy Gumdrop) <https://github.com/CandyGumdrop>`_, 1905 1906* Fixed ``format_to`` formatting to ``wmemory_buffer`` 1907 (`#874 <https://github.com/fmtlib/fmt/issues/874>`_). 1908 19095.2.0 - 2018-09-13 1910------------------ 1911 1912* Optimized format string parsing and argument processing which resulted in up 1913 to 5x speed up on long format strings and significant performance boost on 1914 various benchmarks. For example, version 5.2 is 2.22x faster than 5.1 on 1915 decimal integer formatting with ``format_to`` (macOS, clang-902.0.39.2): 1916 1917 ================== ======= ======= 1918 Method Time, s Speedup 1919 ================== ======= ======= 1920 fmt::format 5.1 0.58 1921 fmt::format 5.2 0.35 1.66x 1922 fmt::format_to 5.1 0.51 1923 fmt::format_to 5.2 0.23 2.22x 1924 sprintf 0.71 1925 std::to_string 1.01 1926 std::stringstream 1.73 1927 ================== ======= ======= 1928 1929* Changed the ``fmt`` macro from opt-out to opt-in to prevent name collisions. 1930 To enable it define the ``FMT_STRING_ALIAS`` macro to 1 before including 1931 ``fmt/format.h``: 1932 1933 .. code:: c++ 1934 1935 #define FMT_STRING_ALIAS 1 1936 #include <fmt/format.h> 1937 std::string answer = format(fmt("{}"), 42); 1938 1939* Added compile-time format string checks to ``format_to`` overload that takes 1940 ``fmt::memory_buffer`` (`#783 <https://github.com/fmtlib/fmt/issues/783>`_): 1941 1942 .. code:: c++ 1943 1944 fmt::memory_buffer buf; 1945 // Compile-time error: invalid type specifier. 1946 fmt::format_to(buf, fmt("{:d}"), "foo"); 1947 1948* Moved experimental color support to ``fmt/color.h`` and enabled the 1949 new API by default. The old API can be enabled by defining the 1950 ``FMT_DEPRECATED_COLORS`` macro. 1951 1952* Added formatting support for types explicitly convertible to 1953 ``fmt::string_view``: 1954 1955 .. code:: c++ 1956 1957 struct foo { 1958 explicit operator fmt::string_view() const { return "foo"; } 1959 }; 1960 auto s = format("{}", foo()); 1961 1962 In particular, this makes formatting function work with 1963 ``folly::StringPiece``. 1964 1965* Implemented preliminary support for ``char*_t`` by replacing the ``format`` 1966 function overloads with a single function template parameterized on the string 1967 type. 1968 1969* Added support for dynamic argument lists 1970 (`#814 <https://github.com/fmtlib/fmt/issues/814>`_, 1971 `#819 <https://github.com/fmtlib/fmt/pull/819>`_). 1972 Thanks `@MikePopoloski (Michael Popoloski) 1973 <https://github.com/MikePopoloski>`_. 1974 1975* Reduced executable size overhead for embedded targets using newlib nano by 1976 making locale dependency optional 1977 (`#839 <https://github.com/fmtlib/fmt/pull/839>`_). 1978 Thanks `@teajay-fr (Thomas Benard) <https://github.com/teajay-fr>`_. 1979 1980* Keep ``noexcept`` specifier when exceptions are disabled 1981 (`#801 <https://github.com/fmtlib/fmt/issues/801>`_, 1982 `#810 <https://github.com/fmtlib/fmt/pull/810>`_). 1983 Thanks `@qis (Alexej Harm) <https://github.com/qis>`_. 1984 1985* Fixed formatting of user-defined types providing ``operator<<`` with 1986 ``format_to_n`` 1987 (`#806 <https://github.com/fmtlib/fmt/pull/806>`_). 1988 Thanks `@mkurdej (Marek Kurdej) <https://github.com/mkurdej>`_. 1989 1990* Fixed dynamic linkage of new symbols 1991 (`#808 <https://github.com/fmtlib/fmt/issues/808>`_). 1992 1993* Fixed global initialization issue 1994 (`#807 <https://github.com/fmtlib/fmt/issues/807>`_): 1995 1996 .. code:: c++ 1997 1998 // This works on compilers with constexpr support. 1999 static const std::string answer = fmt::format("{}", 42); 2000 2001* Fixed various compiler warnings and errors 2002 (`#804 <https://github.com/fmtlib/fmt/pull/804>`_, 2003 `#809 <https://github.com/fmtlib/fmt/issues/809>`_, 2004 `#811 <https://github.com/fmtlib/fmt/pull/811>`_, 2005 `#822 <https://github.com/fmtlib/fmt/issues/822>`_, 2006 `#827 <https://github.com/fmtlib/fmt/pull/827>`_, 2007 `#830 <https://github.com/fmtlib/fmt/issues/830>`_, 2008 `#838 <https://github.com/fmtlib/fmt/pull/838>`_, 2009 `#843 <https://github.com/fmtlib/fmt/issues/843>`_, 2010 `#844 <https://github.com/fmtlib/fmt/pull/844>`_, 2011 `#851 <https://github.com/fmtlib/fmt/issues/851>`_, 2012 `#852 <https://github.com/fmtlib/fmt/pull/852>`_, 2013 `#854 <https://github.com/fmtlib/fmt/pull/854>`_). 2014 Thanks `@henryiii (Henry Schreiner) <https://github.com/henryiii>`_, 2015 `@medithe <https://github.com/medithe>`_, and 2016 `@eliasdaler (Elias Daler) <https://github.com/eliasdaler>`_. 2017 20185.1.0 - 2018-07-05 2019------------------ 2020 2021* Added experimental support for RGB color output enabled with 2022 the ``FMT_EXTENDED_COLORS`` macro: 2023 2024 .. code:: c++ 2025 2026 #define FMT_EXTENDED_COLORS 2027 #define FMT_HEADER_ONLY // or compile fmt with FMT_EXTENDED_COLORS defined 2028 #include <fmt/format.h> 2029 2030 fmt::print(fmt::color::steel_blue, "Some beautiful text"); 2031 2032 The old API (the ``print_colored`` and ``vprint_colored`` functions and the 2033 ``color`` enum) is now deprecated. 2034 (`#762 <https://github.com/fmtlib/fmt/issues/762>`_ 2035 `#767 <https://github.com/fmtlib/fmt/pull/767>`_). 2036 thanks `@Remotion (Remo) <https://github.com/Remotion>`_. 2037 2038* Added quotes to strings in ranges and tuples 2039 (`#766 <https://github.com/fmtlib/fmt/pull/766>`_). 2040 Thanks `@Remotion (Remo) <https://github.com/Remotion>`_. 2041 2042* Made ``format_to`` work with ``basic_memory_buffer`` 2043 (`#776 <https://github.com/fmtlib/fmt/issues/776>`_). 2044 2045* Added ``vformat_to_n`` and ``wchar_t`` overload of ``format_to_n`` 2046 (`#764 <https://github.com/fmtlib/fmt/issues/764>`_, 2047 `#769 <https://github.com/fmtlib/fmt/issues/769>`_). 2048 2049* Made ``is_range`` and ``is_tuple_like`` part of public (experimental) API 2050 to allow specialization for user-defined types 2051 (`#751 <https://github.com/fmtlib/fmt/issues/751>`_, 2052 `#759 <https://github.com/fmtlib/fmt/pull/759>`_). 2053 Thanks `@drrlvn (Dror Levin) <https://github.com/drrlvn>`_. 2054 2055* Added more compilers to continuous integration and increased ``FMT_PEDANTIC`` 2056 warning levels 2057 (`#736 <https://github.com/fmtlib/fmt/pull/736>`_). 2058 Thanks `@eliaskosunen (Elias Kosunen) <https://github.com/eliaskosunen>`_. 2059 2060* Fixed compilation with MSVC 2013. 2061 2062* Fixed handling of user-defined types in ``format_to`` 2063 (`#793 <https://github.com/fmtlib/fmt/issues/793>`_). 2064 2065* Forced linking of inline ``vformat`` functions into the library 2066 (`#795 <https://github.com/fmtlib/fmt/issues/795>`_). 2067 2068* Fixed incorrect call to on_align in ``'{:}='`` 2069 (`#750 <https://github.com/fmtlib/fmt/issues/750>`_). 2070 2071* Fixed floating-point formatting to a non-back_insert_iterator with sign & 2072 numeric alignment specified 2073 (`#756 <https://github.com/fmtlib/fmt/issues/756>`_). 2074 2075* Fixed formatting to an array with ``format_to_n`` 2076 (`#778 <https://github.com/fmtlib/fmt/issues/778>`_). 2077 2078* Fixed formatting of more than 15 named arguments 2079 (`#754 <https://github.com/fmtlib/fmt/issues/754>`_). 2080 2081* Fixed handling of compile-time strings when including ``fmt/ostream.h``. 2082 (`#768 <https://github.com/fmtlib/fmt/issues/768>`_). 2083 2084* Fixed various compiler warnings and errors 2085 (`#742 <https://github.com/fmtlib/fmt/issues/742>`_, 2086 `#748 <https://github.com/fmtlib/fmt/issues/748>`_, 2087 `#752 <https://github.com/fmtlib/fmt/issues/752>`_, 2088 `#770 <https://github.com/fmtlib/fmt/issues/770>`_, 2089 `#775 <https://github.com/fmtlib/fmt/pull/775>`_, 2090 `#779 <https://github.com/fmtlib/fmt/issues/779>`_, 2091 `#780 <https://github.com/fmtlib/fmt/pull/780>`_, 2092 `#790 <https://github.com/fmtlib/fmt/pull/790>`_, 2093 `#792 <https://github.com/fmtlib/fmt/pull/792>`_, 2094 `#800 <https://github.com/fmtlib/fmt/pull/800>`_). 2095 Thanks `@Remotion (Remo) <https://github.com/Remotion>`_, 2096 `@gabime (Gabi Melman) <https://github.com/gabime>`_, 2097 `@foonathan (Jonathan Müller) <https://github.com/foonathan>`_, 2098 `@Dark-Passenger (Dhruv Paranjape) <https://github.com/Dark-Passenger>`_, and 2099 `@0x8000-0000 (Sign Bit) <https://github.com/0x8000-0000>`_. 2100 21015.0.0 - 2018-05-21 2102------------------ 2103 2104* Added a requirement for partial C++11 support, most importantly variadic 2105 templates and type traits, and dropped ``FMT_VARIADIC_*`` emulation macros. 2106 Variadic templates are available since GCC 4.4, Clang 2.9 and MSVC 18.0 (2013). 2107 For older compilers use {fmt} `version 4.x 2108 <https://github.com/fmtlib/fmt/releases/tag/4.1.0>`_ which continues to be 2109 maintained and works with C++98 compilers. 2110 2111* Renamed symbols to follow standard C++ naming conventions and proposed a subset 2112 of the library for standardization in `P0645R2 Text Formatting 2113 <https://wg21.link/P0645>`_. 2114 2115* Implemented ``constexpr`` parsing of format strings and `compile-time format 2116 string checks 2117 <https://fmt.dev/latest/api.html#compile-time-format-string-checks>`_. For 2118 example 2119 2120 .. code:: c++ 2121 2122 #include <fmt/format.h> 2123 2124 std::string s = format(fmt("{:d}"), "foo"); 2125 2126 gives a compile-time error because ``d`` is an invalid specifier for strings 2127 (`godbolt <https://godbolt.org/g/rnCy9Q>`__):: 2128 2129 ... 2130 <source>:4:19: note: in instantiation of function template specialization 'fmt::v5::format<S, char [4]>' requested here 2131 std::string s = format(fmt("{:d}"), "foo"); 2132 ^ 2133 format.h:1337:13: note: non-constexpr function 'on_error' cannot be used in a constant expression 2134 handler.on_error("invalid type specifier"); 2135 2136 Compile-time checks require relaxed ``constexpr`` (C++14 feature) support. If 2137 the latter is not available, checks will be performed at runtime. 2138 2139* Separated format string parsing and formatting in the extension API to enable 2140 compile-time format string processing. For example 2141 2142 .. code:: c++ 2143 2144 struct Answer {}; 2145 2146 namespace fmt { 2147 template <> 2148 struct formatter<Answer> { 2149 constexpr auto parse(parse_context& ctx) { 2150 auto it = ctx.begin(); 2151 spec = *it; 2152 if (spec != 'd' && spec != 's') 2153 throw format_error("invalid specifier"); 2154 return ++it; 2155 } 2156 2157 template <typename FormatContext> 2158 auto format(Answer, FormatContext& ctx) { 2159 return spec == 's' ? 2160 format_to(ctx.begin(), "{}", "fourty-two") : 2161 format_to(ctx.begin(), "{}", 42); 2162 } 2163 2164 char spec = 0; 2165 }; 2166 } 2167 2168 std::string s = format(fmt("{:x}"), Answer()); 2169 2170 gives a compile-time error due to invalid format specifier (`godbolt 2171 <https://godbolt.org/g/2jQ1Dv>`__):: 2172 2173 ... 2174 <source>:12:45: error: expression '<throw-expression>' is not a constant expression 2175 throw format_error("invalid specifier"); 2176 2177* Added `iterator support 2178 <https://fmt.dev/latest/api.html#output-iterator-support>`_: 2179 2180 .. code:: c++ 2181 2182 #include <vector> 2183 #include <fmt/format.h> 2184 2185 std::vector<char> out; 2186 fmt::format_to(std::back_inserter(out), "{}", 42); 2187 2188* Added the `format_to_n 2189 <https://fmt.dev/latest/api.html#_CPPv2N3fmt11format_to_nE8OutputItNSt6size_tE11string_viewDpRK4Args>`_ 2190 function that restricts the output to the specified number of characters 2191 (`#298 <https://github.com/fmtlib/fmt/issues/298>`_): 2192 2193 .. code:: c++ 2194 2195 char out[4]; 2196 fmt::format_to_n(out, sizeof(out), "{}", 12345); 2197 // out == "1234" (without terminating '\0') 2198 2199* Added the `formatted_size 2200 <https://fmt.dev/latest/api.html#_CPPv2N3fmt14formatted_sizeE11string_viewDpRK4Args>`_ 2201 function for computing the output size: 2202 2203 .. code:: c++ 2204 2205 #include <fmt/format.h> 2206 2207 auto size = fmt::formatted_size("{}", 12345); // size == 5 2208 2209* Improved compile times by reducing dependencies on standard headers and 2210 providing a lightweight `core API <https://fmt.dev/latest/api.html#core-api>`_: 2211 2212 .. code:: c++ 2213 2214 #include <fmt/core.h> 2215 2216 fmt::print("The answer is {}.", 42); 2217 2218 See `Compile time and code bloat 2219 <https://github.com/fmtlib/fmt#compile-time-and-code-bloat>`_. 2220 2221* Added the `make_format_args 2222 <https://fmt.dev/latest/api.html#_CPPv2N3fmt16make_format_argsEDpRK4Args>`_ 2223 function for capturing formatting arguments: 2224 2225 .. code:: c++ 2226 2227 // Prints formatted error message. 2228 void vreport_error(const char *format, fmt::format_args args) { 2229 fmt::print("Error: "); 2230 fmt::vprint(format, args); 2231 } 2232 template <typename... Args> 2233 void report_error(const char *format, const Args & ... args) { 2234 vreport_error(format, fmt::make_format_args(args...)); 2235 } 2236 2237* Added the ``make_printf_args`` function for capturing ``printf`` arguments 2238 (`#687 <https://github.com/fmtlib/fmt/issues/687>`_, 2239 `#694 <https://github.com/fmtlib/fmt/pull/694>`_). 2240 Thanks `@Kronuz (Germán Méndez Bravo) <https://github.com/Kronuz>`_. 2241 2242* Added prefix ``v`` to non-variadic functions taking ``format_args`` to 2243 distinguish them from variadic ones: 2244 2245 .. code:: c++ 2246 2247 std::string vformat(string_view format_str, format_args args); 2248 2249 template <typename... Args> 2250 std::string format(string_view format_str, const Args & ... args); 2251 2252* Added experimental support for formatting ranges, containers and tuple-like 2253 types in ``fmt/ranges.h`` (`#735 <https://github.com/fmtlib/fmt/pull/735>`_): 2254 2255 .. code:: c++ 2256 2257 #include <fmt/ranges.h> 2258 2259 std::vector<int> v = {1, 2, 3}; 2260 fmt::print("{}", v); // prints {1, 2, 3} 2261 2262 Thanks `@Remotion (Remo) <https://github.com/Remotion>`_. 2263 2264* Implemented ``wchar_t`` date and time formatting 2265 (`#712 <https://github.com/fmtlib/fmt/pull/712>`_): 2266 2267 .. code:: c++ 2268 2269 #include <fmt/time.h> 2270 2271 std::time_t t = std::time(nullptr); 2272 auto s = fmt::format(L"The date is {:%Y-%m-%d}.", *std::localtime(&t)); 2273 2274 Thanks `@DanielaE (Daniela Engert) <https://github.com/DanielaE>`_. 2275 2276* Provided more wide string overloads 2277 (`#724 <https://github.com/fmtlib/fmt/pull/724>`_). 2278 Thanks `@DanielaE (Daniela Engert) <https://github.com/DanielaE>`_. 2279 2280* Switched from a custom null-terminated string view class to ``string_view`` 2281 in the format API and provided ``fmt::string_view`` which implements a subset 2282 of ``std::string_view`` API for pre-C++17 systems. 2283 2284* Added support for ``std::experimental::string_view`` 2285 (`#607 <https://github.com/fmtlib/fmt/pull/607>`_): 2286 2287 .. code:: c++ 2288 2289 #include <fmt/core.h> 2290 #include <experimental/string_view> 2291 2292 fmt::print("{}", std::experimental::string_view("foo")); 2293 2294 Thanks `@virgiliofornazin (Virgilio Alexandre Fornazin) 2295 <https://github.com/virgiliofornazin>`__. 2296 2297* Allowed mixing named and automatic arguments: 2298 2299 .. code:: c++ 2300 2301 fmt::format("{} {two}", 1, fmt::arg("two", 2)); 2302 2303* Removed the write API in favor of the `format API 2304 <https://fmt.dev/latest/api.html#format-api>`_ with compile-time handling of 2305 format strings. 2306 2307* Disallowed formatting of multibyte strings into a wide character target 2308 (`#606 <https://github.com/fmtlib/fmt/pull/606>`_). 2309 2310* Improved documentation 2311 (`#515 <https://github.com/fmtlib/fmt/pull/515>`_, 2312 `#614 <https://github.com/fmtlib/fmt/issues/614>`_, 2313 `#617 <https://github.com/fmtlib/fmt/pull/617>`_, 2314 `#661 <https://github.com/fmtlib/fmt/pull/661>`_, 2315 `#680 <https://github.com/fmtlib/fmt/pull/680>`_). 2316 Thanks `@ibell (Ian Bell) <https://github.com/ibell>`_, 2317 `@mihaitodor (Mihai Todor) <https://github.com/mihaitodor>`_, and 2318 `@johnthagen <https://github.com/johnthagen>`_. 2319 2320* Implemented more efficient handling of large number of format arguments. 2321 2322* Introduced an inline namespace for symbol versioning. 2323 2324* Added debug postfix ``d`` to the ``fmt`` library name 2325 (`#636 <https://github.com/fmtlib/fmt/issues/636>`_). 2326 2327* Removed unnecessary ``fmt/`` prefix in includes 2328 (`#397 <https://github.com/fmtlib/fmt/pull/397>`_). 2329 Thanks `@chronoxor (Ivan Shynkarenka) <https://github.com/chronoxor>`_. 2330 2331* Moved ``fmt/*.h`` to ``include/fmt/*.h`` to prevent irrelevant files and 2332 directories appearing on the include search paths when fmt is used as a 2333 subproject and moved source files to the ``src`` directory. 2334 2335* Added qmake project file ``support/fmt.pro`` 2336 (`#641 <https://github.com/fmtlib/fmt/pull/641>`_). 2337 Thanks `@cowo78 (Giuseppe Corbelli) <https://github.com/cowo78>`_. 2338 2339* Added Gradle build file ``support/build.gradle`` 2340 (`#649 <https://github.com/fmtlib/fmt/pull/649>`_). 2341 Thanks `@luncliff (Park DongHa) <https://github.com/luncliff>`_. 2342 2343* Removed ``FMT_CPPFORMAT`` CMake option. 2344 2345* Fixed a name conflict with the macro ``CHAR_WIDTH`` in glibc 2346 (`#616 <https://github.com/fmtlib/fmt/pull/616>`_). 2347 Thanks `@aroig (Abdó Roig-Maranges) <https://github.com/aroig>`_. 2348 2349* Fixed handling of nested braces in ``fmt::join`` 2350 (`#638 <https://github.com/fmtlib/fmt/issues/638>`_). 2351 2352* Added ``SOURCELINK_SUFFIX`` for compatibility with Sphinx 1.5 2353 (`#497 <https://github.com/fmtlib/fmt/pull/497>`_). 2354 Thanks `@ginggs (Graham Inggs) <https://github.com/ginggs>`_. 2355 2356* Added a missing ``inline`` in the header-only mode 2357 (`#626 <https://github.com/fmtlib/fmt/pull/626>`_). 2358 Thanks `@aroig (Abdó Roig-Maranges) <https://github.com/aroig>`_. 2359 2360* Fixed various compiler warnings 2361 (`#640 <https://github.com/fmtlib/fmt/pull/640>`_, 2362 `#656 <https://github.com/fmtlib/fmt/pull/656>`_, 2363 `#679 <https://github.com/fmtlib/fmt/pull/679>`_, 2364 `#681 <https://github.com/fmtlib/fmt/pull/681>`_, 2365 `#705 <https://github.com/fmtlib/fmt/pull/705>`__, 2366 `#715 <https://github.com/fmtlib/fmt/issues/715>`_, 2367 `#717 <https://github.com/fmtlib/fmt/pull/717>`_, 2368 `#720 <https://github.com/fmtlib/fmt/pull/720>`_, 2369 `#723 <https://github.com/fmtlib/fmt/pull/723>`_, 2370 `#726 <https://github.com/fmtlib/fmt/pull/726>`_, 2371 `#730 <https://github.com/fmtlib/fmt/pull/730>`_, 2372 `#739 <https://github.com/fmtlib/fmt/pull/739>`_). 2373 Thanks `@peterbell10 <https://github.com/peterbell10>`_, 2374 `@LarsGullik <https://github.com/LarsGullik>`_, 2375 `@foonathan (Jonathan Müller) <https://github.com/foonathan>`_, 2376 `@eliaskosunen (Elias Kosunen) <https://github.com/eliaskosunen>`_, 2377 `@christianparpart (Christian Parpart) <https://github.com/christianparpart>`_, 2378 `@DanielaE (Daniela Engert) <https://github.com/DanielaE>`_, 2379 and `@mwinterb <https://github.com/mwinterb>`_. 2380 2381* Worked around an MSVC bug and fixed several warnings 2382 (`#653 <https://github.com/fmtlib/fmt/pull/653>`_). 2383 Thanks `@alabuzhev (Alex Alabuzhev) <https://github.com/alabuzhev>`_. 2384 2385* Worked around GCC bug 67371 2386 (`#682 <https://github.com/fmtlib/fmt/issues/682>`_). 2387 2388* Fixed compilation with ``-fno-exceptions`` 2389 (`#655 <https://github.com/fmtlib/fmt/pull/655>`_). 2390 Thanks `@chenxiaolong (Andrew Gunnerson) <https://github.com/chenxiaolong>`_. 2391 2392* Made ``constexpr remove_prefix`` gcc version check tighter 2393 (`#648 <https://github.com/fmtlib/fmt/issues/648>`_). 2394 2395* Renamed internal type enum constants to prevent collision with poorly written 2396 C libraries (`#644 <https://github.com/fmtlib/fmt/issues/644>`_). 2397 2398* Added detection of ``wostream operator<<`` 2399 (`#650 <https://github.com/fmtlib/fmt/issues/650>`_). 2400 2401* Fixed compilation on OpenBSD 2402 (`#660 <https://github.com/fmtlib/fmt/pull/660>`_). 2403 Thanks `@hubslave <https://github.com/hubslave>`_. 2404 2405* Fixed compilation on FreeBSD 12 2406 (`#732 <https://github.com/fmtlib/fmt/pull/732>`_). 2407 Thanks `@dankm <https://github.com/dankm>`_. 2408 2409* Fixed compilation when there is a mismatch between ``-std`` options between 2410 the library and user code 2411 (`#664 <https://github.com/fmtlib/fmt/issues/664>`_). 2412 2413* Fixed compilation with GCC 7 and ``-std=c++11`` 2414 (`#734 <https://github.com/fmtlib/fmt/issues/734>`_). 2415 2416* Improved generated binary code on GCC 7 and older 2417 (`#668 <https://github.com/fmtlib/fmt/issues/668>`_). 2418 2419* Fixed handling of numeric alignment with no width 2420 (`#675 <https://github.com/fmtlib/fmt/issues/675>`_). 2421 2422* Fixed handling of empty strings in UTF8/16 converters 2423 (`#676 <https://github.com/fmtlib/fmt/pull/676>`_). 2424 Thanks `@vgalka-sl (Vasili Galka) <https://github.com/vgalka-sl>`_. 2425 2426* Fixed formatting of an empty ``string_view`` 2427 (`#689 <https://github.com/fmtlib/fmt/issues/689>`_). 2428 2429* Fixed detection of ``string_view`` on libc++ 2430 (`#686 <https://github.com/fmtlib/fmt/issues/686>`_). 2431 2432* Fixed DLL issues (`#696 <https://github.com/fmtlib/fmt/pull/696>`_). 2433 Thanks `@sebkoenig <https://github.com/sebkoenig>`_. 2434 2435* Fixed compile checks for mixing narrow and wide strings 2436 (`#690 <https://github.com/fmtlib/fmt/issues/690>`_). 2437 2438* Disabled unsafe implicit conversion to ``std::string`` 2439 (`#729 <https://github.com/fmtlib/fmt/issues/729>`_). 2440 2441* Fixed handling of reused format specs (as in ``fmt::join``) for pointers 2442 (`#725 <https://github.com/fmtlib/fmt/pull/725>`_). 2443 Thanks `@mwinterb <https://github.com/mwinterb>`_. 2444 2445* Fixed installation of ``fmt/ranges.h`` 2446 (`#738 <https://github.com/fmtlib/fmt/pull/738>`_). 2447 Thanks `@sv1990 <https://github.com/sv1990>`_. 2448 24494.1.0 - 2017-12-20 2450------------------ 2451 2452* Added ``fmt::to_wstring()`` in addition to ``fmt::to_string()`` 2453 (`#559 <https://github.com/fmtlib/fmt/pull/559>`_). 2454 Thanks `@alabuzhev (Alex Alabuzhev) <https://github.com/alabuzhev>`_. 2455 2456* Added support for C++17 ``std::string_view`` 2457 (`#571 <https://github.com/fmtlib/fmt/pull/571>`_ and 2458 `#578 <https://github.com/fmtlib/fmt/pull/578>`_). 2459 Thanks `@thelostt (Mário Feroldi) <https://github.com/thelostt>`_ and 2460 `@mwinterb <https://github.com/mwinterb>`_. 2461 2462* Enabled stream exceptions to catch errors 2463 (`#581 <https://github.com/fmtlib/fmt/issues/581>`_). 2464 Thanks `@crusader-mike <https://github.com/crusader-mike>`_. 2465 2466* Allowed formatting of class hierarchies with ``fmt::format_arg()`` 2467 (`#547 <https://github.com/fmtlib/fmt/pull/547>`_). 2468 Thanks `@rollbear (Björn Fahller) <https://github.com/rollbear>`_. 2469 2470* Removed limitations on character types 2471 (`#563 <https://github.com/fmtlib/fmt/pull/563>`_). 2472 Thanks `@Yelnats321 (Elnar Dakeshov) <https://github.com/Yelnats321>`_. 2473 2474* Conditionally enabled use of ``std::allocator_traits`` 2475 (`#583 <https://github.com/fmtlib/fmt/pull/583>`_). 2476 Thanks `@mwinterb <https://github.com/mwinterb>`_. 2477 2478* Added support for ``const`` variadic member function emulation with 2479 ``FMT_VARIADIC_CONST`` (`#591 <https://github.com/fmtlib/fmt/pull/591>`_). 2480 Thanks `@ludekvodicka (Ludek Vodicka) <https://github.com/ludekvodicka>`_. 2481 2482* Various bugfixes: bad overflow check, unsupported implicit type conversion 2483 when determining formatting function, test segfaults 2484 (`#551 <https://github.com/fmtlib/fmt/issues/551>`_), ill-formed macros 2485 (`#542 <https://github.com/fmtlib/fmt/pull/542>`_) and ambiguous overloads 2486 (`#580 <https://github.com/fmtlib/fmt/issues/580>`_). 2487 Thanks `@xylosper (Byoung-young Lee) <https://github.com/xylosper>`_. 2488 2489* Prevented warnings on MSVC (`#605 <https://github.com/fmtlib/fmt/pull/605>`_, 2490 `#602 <https://github.com/fmtlib/fmt/pull/602>`_, and 2491 `#545 <https://github.com/fmtlib/fmt/pull/545>`_), 2492 clang (`#582 <https://github.com/fmtlib/fmt/pull/582>`_), 2493 GCC (`#573 <https://github.com/fmtlib/fmt/issues/573>`_), 2494 various conversion warnings (`#609 <https://github.com/fmtlib/fmt/pull/609>`_, 2495 `#567 <https://github.com/fmtlib/fmt/pull/567>`_, 2496 `#553 <https://github.com/fmtlib/fmt/pull/553>`_ and 2497 `#553 <https://github.com/fmtlib/fmt/pull/553>`_), and added ``override`` and 2498 ``[[noreturn]]`` (`#549 <https://github.com/fmtlib/fmt/pull/549>`_ and 2499 `#555 <https://github.com/fmtlib/fmt/issues/555>`_). 2500 Thanks `@alabuzhev (Alex Alabuzhev) <https://github.com/alabuzhev>`_, 2501 `@virgiliofornazin (Virgilio Alexandre Fornazin) 2502 <https://gihtub.com/virgiliofornazin>`_, 2503 `@alexanderbock (Alexander Bock) <https://github.com/alexanderbock>`_, 2504 `@yumetodo <https://github.com/yumetodo>`_, 2505 `@VaderY (Császár Mátyás) <https://github.com/VaderY>`_, 2506 `@jpcima (JP Cimalando) <https://github.com/jpcima>`_, 2507 `@thelostt (Mário Feroldi) <https://github.com/thelostt>`_, and 2508 `@Manu343726 (Manu Sánchez) <https://github.com/Manu343726>`_. 2509 2510* Improved CMake: Used ``GNUInstallDirs`` to set installation location 2511 (`#610 <https://github.com/fmtlib/fmt/pull/610>`_) and fixed warnings 2512 (`#536 <https://github.com/fmtlib/fmt/pull/536>`_ and 2513 `#556 <https://github.com/fmtlib/fmt/pull/556>`_). 2514 Thanks `@mikecrowe (Mike Crowe) <https://github.com/mikecrowe>`_, 2515 `@evgen231 <https://github.com/evgen231>`_ and 2516 `@henryiii (Henry Schreiner) <https://github.com/henryiii>`_. 2517 25184.0.0 - 2017-06-27 2519------------------ 2520 2521* Removed old compatibility headers ``cppformat/*.h`` and CMake options 2522 (`#527 <https://github.com/fmtlib/fmt/pull/527>`_). 2523 Thanks `@maddinat0r (Alex Martin) <https://github.com/maddinat0r>`_. 2524 2525* Added ``string.h`` containing ``fmt::to_string()`` as alternative to 2526 ``std::to_string()`` as well as other string writer functionality 2527 (`#326 <https://github.com/fmtlib/fmt/issues/326>`_ and 2528 `#441 <https://github.com/fmtlib/fmt/pull/441>`_): 2529 2530 .. code:: c++ 2531 2532 #include "fmt/string.h" 2533 2534 std::string answer = fmt::to_string(42); 2535 2536 Thanks to `@glebov-andrey (Andrey Glebov) 2537 <https://github.com/glebov-andrey>`_. 2538 2539* Moved ``fmt::printf()`` to new ``printf.h`` header and allowed ``%s`` as 2540 generic specifier (`#453 <https://github.com/fmtlib/fmt/pull/453>`_), 2541 made ``%.f`` more conformant to regular ``printf()`` 2542 (`#490 <https://github.com/fmtlib/fmt/pull/490>`_), added custom writer 2543 support (`#476 <https://github.com/fmtlib/fmt/issues/476>`_) and implemented 2544 missing custom argument formatting 2545 (`#339 <https://github.com/fmtlib/fmt/pull/339>`_ and 2546 `#340 <https://github.com/fmtlib/fmt/pull/340>`_): 2547 2548 .. code:: c++ 2549 2550 #include "fmt/printf.h" 2551 2552 // %s format specifier can be used with any argument type. 2553 fmt::printf("%s", 42); 2554 2555 Thanks `@mojoBrendan <https://github.com/mojoBrendan>`_, 2556 `@manylegged (Arthur Danskin) <https://github.com/manylegged>`_ and 2557 `@spacemoose (Glen Stark) <https://github.com/spacemoose>`_. 2558 See also `#360 <https://github.com/fmtlib/fmt/issues/360>`_, 2559 `#335 <https://github.com/fmtlib/fmt/issues/335>`_ and 2560 `#331 <https://github.com/fmtlib/fmt/issues/331>`_. 2561 2562* Added ``container.h`` containing a ``BasicContainerWriter`` 2563 to write to containers like ``std::vector`` 2564 (`#450 <https://github.com/fmtlib/fmt/pull/450>`_). 2565 Thanks `@polyvertex (Jean-Charles Lefebvre) <https://github.com/polyvertex>`_. 2566 2567* Added ``fmt::join()`` function that takes a range and formats 2568 its elements separated by a given string 2569 (`#466 <https://github.com/fmtlib/fmt/pull/466>`_): 2570 2571 .. code:: c++ 2572 2573 #include "fmt/format.h" 2574 2575 std::vector<double> v = {1.2, 3.4, 5.6}; 2576 // Prints "(+01.20, +03.40, +05.60)". 2577 fmt::print("({:+06.2f})", fmt::join(v.begin(), v.end(), ", ")); 2578 2579 Thanks `@olivier80 <https://github.com/olivier80>`_. 2580 2581* Added support for custom formatting specifications to simplify customization 2582 of built-in formatting (`#444 <https://github.com/fmtlib/fmt/pull/444>`_). 2583 Thanks `@polyvertex (Jean-Charles Lefebvre) <https://github.com/polyvertex>`_. 2584 See also `#439 <https://github.com/fmtlib/fmt/issues/439>`_. 2585 2586* Added ``fmt::format_system_error()`` for error code formatting 2587 (`#323 <https://github.com/fmtlib/fmt/issues/323>`_ and 2588 `#526 <https://github.com/fmtlib/fmt/pull/526>`_). 2589 Thanks `@maddinat0r (Alex Martin) <https://github.com/maddinat0r>`_. 2590 2591* Added thread-safe ``fmt::localtime()`` and ``fmt::gmtime()`` 2592 as replacement for the standard version to ``time.h`` 2593 (`#396 <https://github.com/fmtlib/fmt/pull/396>`_). 2594 Thanks `@codicodi <https://github.com/codicodi>`_. 2595 2596* Internal improvements to ``NamedArg`` and ``ArgLists`` 2597 (`#389 <https://github.com/fmtlib/fmt/pull/389>`_ and 2598 `#390 <https://github.com/fmtlib/fmt/pull/390>`_). 2599 Thanks `@chronoxor <https://github.com/chronoxor>`_. 2600 2601* Fixed crash due to bug in ``FormatBuf`` 2602 (`#493 <https://github.com/fmtlib/fmt/pull/493>`_). 2603 Thanks `@effzeh <https://github.com/effzeh>`_. See also 2604 `#480 <https://github.com/fmtlib/fmt/issues/480>`_ and 2605 `#491 <https://github.com/fmtlib/fmt/issues/491>`_. 2606 2607* Fixed handling of wide strings in ``fmt::StringWriter``. 2608 2609* Improved compiler error messages 2610 (`#357 <https://github.com/fmtlib/fmt/issues/357>`_). 2611 2612* Fixed various warnings and issues with various compilers 2613 (`#494 <https://github.com/fmtlib/fmt/pull/494>`_, 2614 `#499 <https://github.com/fmtlib/fmt/pull/499>`_, 2615 `#483 <https://github.com/fmtlib/fmt/pull/483>`_, 2616 `#485 <https://github.com/fmtlib/fmt/pull/485>`_, 2617 `#482 <https://github.com/fmtlib/fmt/pull/482>`_, 2618 `#475 <https://github.com/fmtlib/fmt/pull/475>`_, 2619 `#473 <https://github.com/fmtlib/fmt/pull/473>`_ and 2620 `#414 <https://github.com/fmtlib/fmt/pull/414>`_). 2621 Thanks `@chronoxor <https://github.com/chronoxor>`_, 2622 `@zhaohuaxishi <https://github.com/zhaohuaxishi>`_, 2623 `@pkestene (Pierre Kestener) <https://github.com/pkestene>`_, 2624 `@dschmidt (Dominik Schmidt) <https://github.com/dschmidt>`_ and 2625 `@0x414c (Alexey Gorishny) <https://github.com/0x414c>`_ . 2626 2627* Improved CMake: targets are now namespaced 2628 (`#511 <https://github.com/fmtlib/fmt/pull/511>`_ and 2629 `#513 <https://github.com/fmtlib/fmt/pull/513>`_), supported header-only 2630 ``printf.h`` (`#354 <https://github.com/fmtlib/fmt/pull/354>`_), fixed issue 2631 with minimal supported library subset 2632 (`#418 <https://github.com/fmtlib/fmt/issues/418>`_, 2633 `#419 <https://github.com/fmtlib/fmt/pull/419>`_ and 2634 `#420 <https://github.com/fmtlib/fmt/pull/420>`_). 2635 Thanks `@bjoernthiel (Bjoern Thiel) <https://github.com/bjoernthiel>`_, 2636 `@niosHD (Mario Werner) <https://github.com/niosHD>`_, 2637 `@LogicalKnight (Sean LK) <https://github.com/LogicalKnight>`_ and 2638 `@alabuzhev (Alex Alabuzhev) <https://github.com/alabuzhev>`_. 2639 2640* Improved documentation. Thanks to 2641 `@pwm1234 (Phil) <https://github.com/pwm1234>`_ for 2642 `#393 <https://github.com/fmtlib/fmt/pull/393>`_. 2643 26443.0.2 - 2017-06-14 2645------------------ 2646 2647* Added ``FMT_VERSION`` macro 2648 (`#411 <https://github.com/fmtlib/fmt/issues/411>`_). 2649 2650* Used ``FMT_NULL`` instead of literal ``0`` 2651 (`#409 <https://github.com/fmtlib/fmt/pull/409>`_). 2652 Thanks `@alabuzhev (Alex Alabuzhev) <https://github.com/alabuzhev>`_. 2653 2654* Added extern templates for ``format_float`` 2655 (`#413 <https://github.com/fmtlib/fmt/issues/413>`_). 2656 2657* Fixed implicit conversion issue 2658 (`#507 <https://github.com/fmtlib/fmt/issues/507>`_). 2659 2660* Fixed signbit detection (`#423 <https://github.com/fmtlib/fmt/issues/423>`_). 2661 2662* Fixed naming collision (`#425 <https://github.com/fmtlib/fmt/issues/425>`_). 2663 2664* Fixed missing intrinsic for C++/CLI 2665 (`#457 <https://github.com/fmtlib/fmt/pull/457>`_). 2666 Thanks `@calumr (Calum Robinson) <https://github.com/calumr>`_ 2667 2668* Fixed Android detection (`#458 <https://github.com/fmtlib/fmt/pull/458>`_). 2669 Thanks `@Gachapen (Magnus Bjerke Vik) <https://github.com/Gachapen>`_. 2670 2671* Use lean ``windows.h`` if not in header-only mode 2672 (`#503 <https://github.com/fmtlib/fmt/pull/503>`_). 2673 Thanks `@Quentin01 (Quentin Buathier) <https://github.com/Quentin01>`_. 2674 2675* Fixed issue with CMake exporting C++11 flag 2676 (`#445 <https://github.com/fmtlib/fmt/pull/455>`_). 2677 Thanks `@EricWF (Eric) <https://github.com/EricWF>`_. 2678 2679* Fixed issue with nvcc and MSVC compiler bug and MinGW 2680 (`#505 <https://github.com/fmtlib/fmt/issues/505>`_). 2681 2682* Fixed DLL issues (`#469 <https://github.com/fmtlib/fmt/pull/469>`_ and 2683 `#502 <https://github.com/fmtlib/fmt/pull/502>`_). 2684 Thanks `@richardeakin (Richard Eakin) <https://github.com/richardeakin>`_ and 2685 `@AndreasSchoenle (Andreas Schönle) <https://github.com/AndreasSchoenle>`_. 2686 2687* Fixed test compilation under FreeBSD 2688 (`#433 <https://github.com/fmtlib/fmt/issues/433>`_). 2689 2690* Fixed various warnings (`#403 <https://github.com/fmtlib/fmt/pull/403>`_, 2691 `#410 <https://github.com/fmtlib/fmt/pull/410>`_ and 2692 `#510 <https://github.com/fmtlib/fmt/pull/510>`_). 2693 Thanks `@Lecetem <https://github.com/Lectem>`_, 2694 `@chenhayat (Chen Hayat) <https://github.com/chenhayat>`_ and 2695 `@trozen <https://github.com/trozen>`_. 2696 2697* Worked around a broken ``__builtin_clz`` in clang with MS codegen 2698 (`#519 <https://github.com/fmtlib/fmt/issues/519>`_). 2699 2700* Removed redundant include 2701 (`#479 <https://github.com/fmtlib/fmt/issues/479>`_). 2702 2703* Fixed documentation issues. 2704 27053.0.1 - 2016-11-01 2706------------------ 2707* Fixed handling of thousands separator 2708 (`#353 <https://github.com/fmtlib/fmt/issues/353>`_). 2709 2710* Fixed handling of ``unsigned char`` strings 2711 (`#373 <https://github.com/fmtlib/fmt/issues/373>`_). 2712 2713* Corrected buffer growth when formatting time 2714 (`#367 <https://github.com/fmtlib/fmt/issues/367>`_). 2715 2716* Removed warnings under MSVC and clang 2717 (`#318 <https://github.com/fmtlib/fmt/issues/318>`_, 2718 `#250 <https://github.com/fmtlib/fmt/issues/250>`_, also merged 2719 `#385 <https://github.com/fmtlib/fmt/pull/385>`_ and 2720 `#361 <https://github.com/fmtlib/fmt/pull/361>`_). 2721 Thanks `@jcelerier (Jean-Michaël Celerier) <https://github.com/jcelerier>`_ 2722 and `@nmoehrle (Nils Moehrle) <https://github.com/nmoehrle>`_. 2723 2724* Fixed compilation issues under Android 2725 (`#327 <https://github.com/fmtlib/fmt/pull/327>`_, 2726 `#345 <https://github.com/fmtlib/fmt/issues/345>`_ and 2727 `#381 <https://github.com/fmtlib/fmt/pull/381>`_), 2728 FreeBSD (`#358 <https://github.com/fmtlib/fmt/pull/358>`_), 2729 Cygwin (`#388 <https://github.com/fmtlib/fmt/issues/388>`_), 2730 MinGW (`#355 <https://github.com/fmtlib/fmt/issues/355>`_) as well as other 2731 issues (`#350 <https://github.com/fmtlib/fmt/issues/350>`_, 2732 `#366 <https://github.com/fmtlib/fmt/issues/355>`_, 2733 `#348 <https://github.com/fmtlib/fmt/pull/348>`_, 2734 `#402 <https://github.com/fmtlib/fmt/pull/402>`_, 2735 `#405 <https://github.com/fmtlib/fmt/pull/405>`_). 2736 Thanks to `@dpantele (Dmitry) <https://github.com/dpantele>`_, 2737 `@hghwng (Hugh Wang) <https://github.com/hghwng>`_, 2738 `@arvedarved (Tilman Keskinöz) <https://github.com/arvedarved>`_, 2739 `@LogicalKnight (Sean) <https://github.com/LogicalKnight>`_ and 2740 `@JanHellwig (Jan Hellwig) <https://github.com/janhellwig>`_. 2741 2742* Fixed some documentation issues and extended specification 2743 (`#320 <https://github.com/fmtlib/fmt/issues/320>`_, 2744 `#333 <https://github.com/fmtlib/fmt/pull/333>`_, 2745 `#347 <https://github.com/fmtlib/fmt/issues/347>`_, 2746 `#362 <https://github.com/fmtlib/fmt/pull/362>`_). 2747 Thanks to `@smellman (Taro Matsuzawa aka. btm) 2748 <https://github.com/smellman>`_. 2749 27503.0.0 - 2016-05-07 2751------------------ 2752 2753* The project has been renamed from C++ Format (cppformat) to fmt for 2754 consistency with the used namespace and macro prefix 2755 (`#307 <https://github.com/fmtlib/fmt/issues/307>`_). 2756 Library headers are now located in the ``fmt`` directory: 2757 2758 .. code:: c++ 2759 2760 #include "fmt/format.h" 2761 2762 Including ``format.h`` from the ``cppformat`` directory is deprecated 2763 but works via a proxy header which will be removed in the next major version. 2764 2765 The documentation is now available at https://fmt.dev. 2766 2767* Added support for `strftime <http://en.cppreference.com/w/cpp/chrono/c/strftime>`_-like 2768 `date and time formatting <https://fmt.dev/3.0.0/api.html#date-and-time-formatting>`_ 2769 (`#283 <https://github.com/fmtlib/fmt/issues/283>`_): 2770 2771 .. code:: c++ 2772 2773 #include "fmt/time.h" 2774 2775 std::time_t t = std::time(nullptr); 2776 // Prints "The date is 2016-04-29." (with the current date) 2777 fmt::print("The date is {:%Y-%m-%d}.", *std::localtime(&t)); 2778 2779* ``std::ostream`` support including formatting of user-defined types that provide 2780 overloaded ``operator<<`` has been moved to ``fmt/ostream.h``: 2781 2782 .. code:: c++ 2783 2784 #include "fmt/ostream.h" 2785 2786 class Date { 2787 int year_, month_, day_; 2788 public: 2789 Date(int year, int month, int day) : year_(year), month_(month), day_(day) {} 2790 2791 friend std::ostream &operator<<(std::ostream &os, const Date &d) { 2792 return os << d.year_ << '-' << d.month_ << '-' << d.day_; 2793 } 2794 }; 2795 2796 std::string s = fmt::format("The date is {}", Date(2012, 12, 9)); 2797 // s == "The date is 2012-12-9" 2798 2799* Added support for `custom argument formatters 2800 <https://fmt.dev/3.0.0/api.html#argument-formatters>`_ 2801 (`#235 <https://github.com/fmtlib/fmt/issues/235>`_). 2802 2803* Added support for locale-specific integer formatting with the ``n`` specifier 2804 (`#305 <https://github.com/fmtlib/fmt/issues/305>`_): 2805 2806 .. code:: c++ 2807 2808 std::setlocale(LC_ALL, "en_US.utf8"); 2809 fmt::print("cppformat: {:n}\n", 1234567); // prints 1,234,567 2810 2811* Sign is now preserved when formatting an integer with an incorrect ``printf`` 2812 format specifier (`#265 <https://github.com/fmtlib/fmt/issues/265>`_): 2813 2814 .. code:: c++ 2815 2816 fmt::printf("%lld", -42); // prints -42 2817 2818 Note that it would be an undefined behavior in ``std::printf``. 2819 2820* Length modifiers such as ``ll`` are now optional in printf formatting 2821 functions and the correct type is determined automatically 2822 (`#255 <https://github.com/fmtlib/fmt/issues/255>`_): 2823 2824 .. code:: c++ 2825 2826 fmt::printf("%d", std::numeric_limits<long long>::max()); 2827 2828 Note that it would be an undefined behavior in ``std::printf``. 2829 2830* Added initial support for custom formatters 2831 (`#231 <https://github.com/fmtlib/fmt/issues/231>`_). 2832 2833* Fixed detection of user-defined literal support on Intel C++ compiler 2834 (`#311 <https://github.com/fmtlib/fmt/issues/311>`_, 2835 `#312 <https://github.com/fmtlib/fmt/pull/312>`_). 2836 Thanks to `@dean0x7d (Dean Moldovan) <https://github.com/dean0x7d>`_ and 2837 `@speth (Ray Speth) <https://github.com/speth>`_. 2838 2839* Reduced compile time 2840 (`#243 <https://github.com/fmtlib/fmt/pull/243>`_, 2841 `#249 <https://github.com/fmtlib/fmt/pull/249>`_, 2842 `#317 <https://github.com/fmtlib/fmt/issues/317>`_): 2843 2844 .. image:: https://cloud.githubusercontent.com/assets/4831417/11614060/ 2845 b9e826d2-9c36-11e5-8666-d4131bf503ef.png 2846 2847 .. image:: https://cloud.githubusercontent.com/assets/4831417/11614080/ 2848 6ac903cc-9c37-11e5-8165-26df6efae364.png 2849 2850 Thanks to `@dean0x7d (Dean Moldovan) <https://github.com/dean0x7d>`_. 2851 2852* Compile test fixes (`#313 <https://github.com/fmtlib/fmt/pull/313>`_). 2853 Thanks to `@dean0x7d (Dean Moldovan) <https://github.com/dean0x7d>`_. 2854 2855* Documentation fixes (`#239 <https://github.com/fmtlib/fmt/pull/239>`_, 2856 `#248 <https://github.com/fmtlib/fmt/issues/248>`_, 2857 `#252 <https://github.com/fmtlib/fmt/issues/252>`_, 2858 `#258 <https://github.com/fmtlib/fmt/pull/258>`_, 2859 `#260 <https://github.com/fmtlib/fmt/issues/260>`_, 2860 `#301 <https://github.com/fmtlib/fmt/issues/301>`_, 2861 `#309 <https://github.com/fmtlib/fmt/pull/309>`_). 2862 Thanks to `@ReadmeCritic <https://github.com/ReadmeCritic>`_ 2863 `@Gachapen (Magnus Bjerke Vik) <https://github.com/Gachapen>`_ and 2864 `@jwilk (Jakub Wilk) <https://github.com/jwilk>`_. 2865 2866* Fixed compiler and sanitizer warnings 2867 (`#244 <https://github.com/fmtlib/fmt/issues/244>`_, 2868 `#256 <https://github.com/fmtlib/fmt/pull/256>`_, 2869 `#259 <https://github.com/fmtlib/fmt/pull/259>`_, 2870 `#263 <https://github.com/fmtlib/fmt/issues/263>`_, 2871 `#274 <https://github.com/fmtlib/fmt/issues/274>`_, 2872 `#277 <https://github.com/fmtlib/fmt/pull/277>`_, 2873 `#286 <https://github.com/fmtlib/fmt/pull/286>`_, 2874 `#291 <https://github.com/fmtlib/fmt/issues/291>`_, 2875 `#296 <https://github.com/fmtlib/fmt/issues/296>`_, 2876 `#308 <https://github.com/fmtlib/fmt/issues/308>`_) 2877 Thanks to `@mwinterb <https://github.com/mwinterb>`_, 2878 `@pweiskircher (Patrik Weiskircher) <https://github.com/pweiskircher>`_, 2879 `@Naios <https://github.com/Naios>`_. 2880 2881* Improved compatibility with Windows Store apps 2882 (`#280 <https://github.com/fmtlib/fmt/issues/280>`_, 2883 `#285 <https://github.com/fmtlib/fmt/pull/285>`_) 2884 Thanks to `@mwinterb <https://github.com/mwinterb>`_. 2885 2886* Added tests of compatibility with older C++ standards 2887 (`#273 <https://github.com/fmtlib/fmt/pull/273>`_). 2888 Thanks to `@niosHD <https://github.com/niosHD>`_. 2889 2890* Fixed Android build (`#271 <https://github.com/fmtlib/fmt/pull/271>`_). 2891 Thanks to `@newnon <https://github.com/newnon>`_. 2892 2893* Changed ``ArgMap`` to be backed by a vector instead of a map. 2894 (`#261 <https://github.com/fmtlib/fmt/issues/261>`_, 2895 `#262 <https://github.com/fmtlib/fmt/pull/262>`_). 2896 Thanks to `@mwinterb <https://github.com/mwinterb>`_. 2897 2898* Added ``fprintf`` overload that writes to a ``std::ostream`` 2899 (`#251 <https://github.com/fmtlib/fmt/pull/251>`_). 2900 Thanks to `nickhutchinson (Nicholas Hutchinson) <https://github.com/nickhutchinson>`_. 2901 2902* Export symbols when building a Windows DLL 2903 (`#245 <https://github.com/fmtlib/fmt/pull/245>`_). 2904 Thanks to `macdems (Maciek Dems) <https://github.com/macdems>`_. 2905 2906* Fixed compilation on Cygwin (`#304 <https://github.com/fmtlib/fmt/issues/304>`_). 2907 2908* Implemented a workaround for a bug in Apple LLVM version 4.2 of clang 2909 (`#276 <https://github.com/fmtlib/fmt/issues/276>`_). 2910 2911* Implemented a workaround for Google Test bug 2912 `#705 <https://github.com/google/googletest/issues/705>`_ on gcc 6 2913 (`#268 <https://github.com/fmtlib/fmt/issues/268>`_). 2914 Thanks to `octoploid <https://github.com/octoploid>`_. 2915 2916* Removed Biicode support because the latter has been discontinued. 2917 29182.1.1 - 2016-04-11 2919------------------ 2920 2921* The install location for generated CMake files is now configurable via 2922 the ``FMT_CMAKE_DIR`` CMake variable 2923 (`#299 <https://github.com/fmtlib/fmt/pull/299>`_). 2924 Thanks to `@niosHD <https://github.com/niosHD>`_. 2925 2926* Documentation fixes (`#252 <https://github.com/fmtlib/fmt/issues/252>`_). 2927 29282.1.0 - 2016-03-21 2929------------------ 2930 2931* Project layout and build system improvements 2932 (`#267 <https://github.com/fmtlib/fmt/pull/267>`_): 2933 2934 * The code have been moved to the ``cppformat`` directory. 2935 Including ``format.h`` from the top-level directory is deprecated 2936 but works via a proxy header which will be removed in the next 2937 major version. 2938 2939 * C++ Format CMake targets now have proper interface definitions. 2940 2941 * Installed version of the library now supports the header-only 2942 configuration. 2943 2944 * Targets ``doc``, ``install``, and ``test`` are now disabled if C++ Format 2945 is included as a CMake subproject. They can be enabled by setting 2946 ``FMT_DOC``, ``FMT_INSTALL``, and ``FMT_TEST`` in the parent project. 2947 2948 Thanks to `@niosHD <https://github.com/niosHD>`_. 2949 29502.0.1 - 2016-03-13 2951------------------ 2952 2953* Improved CMake find and package support 2954 (`#264 <https://github.com/fmtlib/fmt/issues/264>`_). 2955 Thanks to `@niosHD <https://github.com/niosHD>`_. 2956 2957* Fix compile error with Android NDK and mingw32 2958 (`#241 <https://github.com/fmtlib/fmt/issues/241>`_). 2959 Thanks to `@Gachapen (Magnus Bjerke Vik) <https://github.com/Gachapen>`_. 2960 2961* Documentation fixes 2962 (`#248 <https://github.com/fmtlib/fmt/issues/248>`_, 2963 `#260 <https://github.com/fmtlib/fmt/issues/260>`_). 2964 29652.0.0 - 2015-12-01 2966------------------ 2967 2968General 2969~~~~~~~ 2970 2971* [Breaking] Named arguments 2972 (`#169 <https://github.com/fmtlib/fmt/pull/169>`_, 2973 `#173 <https://github.com/fmtlib/fmt/pull/173>`_, 2974 `#174 <https://github.com/fmtlib/fmt/pull/174>`_): 2975 2976 .. code:: c++ 2977 2978 fmt::print("The answer is {answer}.", fmt::arg("answer", 42)); 2979 2980 Thanks to `@jamboree <https://github.com/jamboree>`_. 2981 2982* [Experimental] User-defined literals for format and named arguments 2983 (`#204 <https://github.com/fmtlib/fmt/pull/204>`_, 2984 `#206 <https://github.com/fmtlib/fmt/pull/206>`_, 2985 `#207 <https://github.com/fmtlib/fmt/pull/207>`_): 2986 2987 .. code:: c++ 2988 2989 using namespace fmt::literals; 2990 fmt::print("The answer is {answer}.", "answer"_a=42); 2991 2992 Thanks to `@dean0x7d (Dean Moldovan) <https://github.com/dean0x7d>`_. 2993 2994* [Breaking] Formatting of more than 16 arguments is now supported when using 2995 variadic templates 2996 (`#141 <https://github.com/fmtlib/fmt/issues/141>`_). 2997 Thanks to `@Shauren <https://github.com/Shauren>`_. 2998 2999* Runtime width specification 3000 (`#168 <https://github.com/fmtlib/fmt/pull/168>`_): 3001 3002 .. code:: c++ 3003 3004 fmt::format("{0:{1}}", 42, 5); // gives " 42" 3005 3006 Thanks to `@jamboree <https://github.com/jamboree>`_. 3007 3008* [Breaking] Enums are now formatted with an overloaded ``std::ostream`` insertion 3009 operator (``operator<<``) if available 3010 (`#232 <https://github.com/fmtlib/fmt/issues/232>`_). 3011 3012* [Breaking] Changed default ``bool`` format to textual, "true" or "false" 3013 (`#170 <https://github.com/fmtlib/fmt/issues/170>`_): 3014 3015 .. code:: c++ 3016 3017 fmt::print("{}", true); // prints "true" 3018 3019 To print ``bool`` as a number use numeric format specifier such as ``d``: 3020 3021 .. code:: c++ 3022 3023 fmt::print("{:d}", true); // prints "1" 3024 3025* ``fmt::printf`` and ``fmt::sprintf`` now support formatting of ``bool`` with the 3026 ``%s`` specifier giving textual output, "true" or "false" 3027 (`#223 <https://github.com/fmtlib/fmt/pull/223>`_): 3028 3029 .. code:: c++ 3030 3031 fmt::printf("%s", true); // prints "true" 3032 3033 Thanks to `@LarsGullik <https://github.com/LarsGullik>`_. 3034 3035* [Breaking] ``signed char`` and ``unsigned char`` are now formatted as integers by default 3036 (`#217 <https://github.com/fmtlib/fmt/pull/217>`_). 3037 3038* [Breaking] Pointers to C strings can now be formatted with the ``p`` specifier 3039 (`#223 <https://github.com/fmtlib/fmt/pull/223>`_): 3040 3041 .. code:: c++ 3042 3043 fmt::print("{:p}", "test"); // prints pointer value 3044 3045 Thanks to `@LarsGullik <https://github.com/LarsGullik>`_. 3046 3047* [Breaking] ``fmt::printf`` and ``fmt::sprintf`` now print null pointers as ``(nil)`` 3048 and null strings as ``(null)`` for consistency with glibc 3049 (`#226 <https://github.com/fmtlib/fmt/pull/226>`_). 3050 Thanks to `@LarsGullik <https://github.com/LarsGullik>`_. 3051 3052* [Breaking] ``fmt::(s)printf`` now supports formatting of objects of user-defined types 3053 that provide an overloaded ``std::ostream`` insertion operator (``operator<<``) 3054 (`#201 <https://github.com/fmtlib/fmt/issues/201>`_): 3055 3056 .. code:: c++ 3057 3058 fmt::printf("The date is %s", Date(2012, 12, 9)); 3059 3060* [Breaking] The ``Buffer`` template is now part of the public API and can be used 3061 to implement custom memory buffers 3062 (`#140 <https://github.com/fmtlib/fmt/issues/140>`_). 3063 Thanks to `@polyvertex (Jean-Charles Lefebvre) <https://github.com/polyvertex>`_. 3064 3065* [Breaking] Improved compatibility between ``BasicStringRef`` and 3066 `std::experimental::basic_string_view 3067 <http://en.cppreference.com/w/cpp/experimental/basic_string_view>`_ 3068 (`#100 <https://github.com/fmtlib/fmt/issues/100>`_, 3069 `#159 <https://github.com/fmtlib/fmt/issues/159>`_, 3070 `#183 <https://github.com/fmtlib/fmt/issues/183>`_): 3071 3072 - Comparison operators now compare string content, not pointers 3073 - ``BasicStringRef::c_str`` replaced by ``BasicStringRef::data`` 3074 - ``BasicStringRef`` is no longer assumed to be null-terminated 3075 3076 References to null-terminated strings are now represented by a new class, 3077 ``BasicCStringRef``. 3078 3079* Dependency on pthreads introduced by Google Test is now optional 3080 (`#185 <https://github.com/fmtlib/fmt/issues/185>`_). 3081 3082* New CMake options ``FMT_DOC``, ``FMT_INSTALL`` and ``FMT_TEST`` to control 3083 generation of ``doc``, ``install`` and ``test`` targets respectively, on by default 3084 (`#197 <https://github.com/fmtlib/fmt/issues/197>`_, 3085 `#198 <https://github.com/fmtlib/fmt/issues/198>`_, 3086 `#200 <https://github.com/fmtlib/fmt/issues/200>`_). 3087 Thanks to `@maddinat0r (Alex Martin) <https://github.com/maddinat0r>`_. 3088 3089* ``noexcept`` is now used when compiling with MSVC2015 3090 (`#215 <https://github.com/fmtlib/fmt/pull/215>`_). 3091 Thanks to `@dmkrepo (Dmitriy) <https://github.com/dmkrepo>`_. 3092 3093* Added an option to disable use of ``windows.h`` when ``FMT_USE_WINDOWS_H`` 3094 is defined as 0 before including ``format.h`` 3095 (`#171 <https://github.com/fmtlib/fmt/issues/171>`_). 3096 Thanks to `@alfps (Alf P. Steinbach) <https://github.com/alfps>`_. 3097 3098* [Breaking] ``windows.h`` is now included with ``NOMINMAX`` unless 3099 ``FMT_WIN_MINMAX`` is defined. This is done to prevent breaking code using 3100 ``std::min`` and ``std::max`` and only affects the header-only configuration 3101 (`#152 <https://github.com/fmtlib/fmt/issues/152>`_, 3102 `#153 <https://github.com/fmtlib/fmt/pull/153>`_, 3103 `#154 <https://github.com/fmtlib/fmt/pull/154>`_). 3104 Thanks to `@DevO2012 <https://github.com/DevO2012>`_. 3105 3106* Improved support for custom character types 3107 (`#171 <https://github.com/fmtlib/fmt/issues/171>`_). 3108 Thanks to `@alfps (Alf P. Steinbach) <https://github.com/alfps>`_. 3109 3110* Added an option to disable use of IOStreams when ``FMT_USE_IOSTREAMS`` 3111 is defined as 0 before including ``format.h`` 3112 (`#205 <https://github.com/fmtlib/fmt/issues/205>`_, 3113 `#208 <https://github.com/fmtlib/fmt/pull/208>`_). 3114 Thanks to `@JodiTheTigger <https://github.com/JodiTheTigger>`_. 3115 3116* Improved detection of ``isnan``, ``isinf`` and ``signbit``. 3117 3118Optimization 3119~~~~~~~~~~~~ 3120 3121* Made formatting of user-defined types more efficient with a custom stream buffer 3122 (`#92 <https://github.com/fmtlib/fmt/issues/92>`_, 3123 `#230 <https://github.com/fmtlib/fmt/pull/230>`_). 3124 Thanks to `@NotImplemented <https://github.com/NotImplemented>`_. 3125 3126* Further improved performance of ``fmt::Writer`` on integer formatting 3127 and fixed a minor regression. Now it is ~7% faster than ``karma::generate`` 3128 on Karma's benchmark 3129 (`#186 <https://github.com/fmtlib/fmt/issues/186>`_). 3130 3131* [Breaking] Reduced `compiled code size 3132 <https://github.com/fmtlib/fmt#compile-time-and-code-bloat>`_ 3133 (`#143 <https://github.com/fmtlib/fmt/issues/143>`_, 3134 `#149 <https://github.com/fmtlib/fmt/pull/149>`_). 3135 3136Distribution 3137~~~~~~~~~~~~ 3138 3139* [Breaking] Headers are now installed in 3140 ``${CMAKE_INSTALL_PREFIX}/include/cppformat`` 3141 (`#178 <https://github.com/fmtlib/fmt/issues/178>`_). 3142 Thanks to `@jackyf (Eugene V. Lyubimkin) <https://github.com/jackyf>`_. 3143 3144* [Breaking] Changed the library name from ``format`` to ``cppformat`` 3145 for consistency with the project name and to avoid potential conflicts 3146 (`#178 <https://github.com/fmtlib/fmt/issues/178>`_). 3147 Thanks to `@jackyf (Eugene V. Lyubimkin) <https://github.com/jackyf>`_. 3148 3149* C++ Format is now available in `Debian <https://www.debian.org/>`_ GNU/Linux 3150 (`stretch <https://packages.debian.org/source/stretch/cppformat>`_, 3151 `sid <https://packages.debian.org/source/sid/cppformat>`_) and 3152 derived distributions such as 3153 `Ubuntu <https://launchpad.net/ubuntu/+source/cppformat>`_ 15.10 and later 3154 (`#155 <https://github.com/fmtlib/fmt/issues/155>`_):: 3155 3156 $ sudo apt-get install libcppformat1-dev 3157 3158 Thanks to `@jackyf (Eugene V. Lyubimkin) <https://github.com/jackyf>`_. 3159 3160* `Packages for Fedora and RHEL <https://admin.fedoraproject.org/pkgdb/package/cppformat/>`_ 3161 are now available. Thanks to Dave Johansen. 3162 3163* C++ Format can now be installed via `Homebrew <http://brew.sh/>`_ on OS X 3164 (`#157 <https://github.com/fmtlib/fmt/issues/157>`_):: 3165 3166 $ brew install cppformat 3167 3168 Thanks to `@ortho <https://github.com/ortho>`_, Anatoliy Bulukin. 3169 3170Documentation 3171~~~~~~~~~~~~~ 3172 3173* Migrated from ReadTheDocs to GitHub Pages for better responsiveness 3174 and reliability 3175 (`#128 <https://github.com/fmtlib/fmt/issues/128>`_). 3176 New documentation address is http://cppformat.github.io/. 3177 3178 3179* Added `Building the documentation 3180 <https://fmt.dev/2.0.0/usage.html#building-the-documentation>`_ 3181 section to the documentation. 3182 3183* Documentation build script is now compatible with Python 3 and newer pip versions. 3184 (`#189 <https://github.com/fmtlib/fmt/pull/189>`_, 3185 `#209 <https://github.com/fmtlib/fmt/issues/209>`_). 3186 Thanks to `@JodiTheTigger <https://github.com/JodiTheTigger>`_ and 3187 `@xentec <https://github.com/xentec>`_. 3188 3189* Documentation fixes and improvements 3190 (`#36 <https://github.com/fmtlib/fmt/issues/36>`_, 3191 `#75 <https://github.com/fmtlib/fmt/issues/75>`_, 3192 `#125 <https://github.com/fmtlib/fmt/issues/125>`_, 3193 `#160 <https://github.com/fmtlib/fmt/pull/160>`_, 3194 `#161 <https://github.com/fmtlib/fmt/pull/161>`_, 3195 `#162 <https://github.com/fmtlib/fmt/issues/162>`_, 3196 `#165 <https://github.com/fmtlib/fmt/issues/165>`_, 3197 `#210 <https://github.com/fmtlib/fmt/issues/210>`_). 3198 Thanks to `@syohex (Syohei YOSHIDA) <https://github.com/syohex>`_ and 3199 bug reporters. 3200 3201* Fixed out-of-tree documentation build 3202 (`#177 <https://github.com/fmtlib/fmt/issues/177>`_). 3203 Thanks to `@jackyf (Eugene V. Lyubimkin) <https://github.com/jackyf>`_. 3204 3205Fixes 3206~~~~~ 3207 3208* Fixed ``initializer_list`` detection 3209 (`#136 <https://github.com/fmtlib/fmt/issues/136>`_). 3210 Thanks to `@Gachapen (Magnus Bjerke Vik) <https://github.com/Gachapen>`_. 3211 3212* [Breaking] Fixed formatting of enums with numeric format specifiers in 3213 ``fmt::(s)printf`` 3214 (`#131 <https://github.com/fmtlib/fmt/issues/131>`_, 3215 `#139 <https://github.com/fmtlib/fmt/issues/139>`_): 3216 3217 .. code:: c++ 3218 3219 enum { ANSWER = 42 }; 3220 fmt::printf("%d", ANSWER); 3221 3222 Thanks to `@Naios <https://github.com/Naios>`_. 3223 3224* Improved compatibility with old versions of MinGW 3225 (`#129 <https://github.com/fmtlib/fmt/issues/129>`_, 3226 `#130 <https://github.com/fmtlib/fmt/pull/130>`_, 3227 `#132 <https://github.com/fmtlib/fmt/issues/132>`_). 3228 Thanks to `@cstamford (Christopher Stamford) <https://github.com/cstamford>`_. 3229 3230* Fixed a compile error on MSVC with disabled exceptions 3231 (`#144 <https://github.com/fmtlib/fmt/issues/144>`_). 3232 3233* Added a workaround for broken implementation of variadic templates in MSVC2012 3234 (`#148 <https://github.com/fmtlib/fmt/issues/148>`_). 3235 3236* Placed the anonymous namespace within ``fmt`` namespace for the header-only 3237 configuration 3238 (`#171 <https://github.com/fmtlib/fmt/issues/171>`_). 3239 Thanks to `@alfps (Alf P. Steinbach) <https://github.com/alfps>`_. 3240 3241* Fixed issues reported by Coverity Scan 3242 (`#187 <https://github.com/fmtlib/fmt/issues/187>`_, 3243 `#192 <https://github.com/fmtlib/fmt/issues/192>`_). 3244 3245* Implemented a workaround for a name lookup bug in MSVC2010 3246 (`#188 <https://github.com/fmtlib/fmt/issues/188>`_). 3247 3248* Fixed compiler warnings 3249 (`#95 <https://github.com/fmtlib/fmt/issues/95>`_, 3250 `#96 <https://github.com/fmtlib/fmt/issues/96>`_, 3251 `#114 <https://github.com/fmtlib/fmt/pull/114>`_, 3252 `#135 <https://github.com/fmtlib/fmt/issues/135>`_, 3253 `#142 <https://github.com/fmtlib/fmt/issues/142>`_, 3254 `#145 <https://github.com/fmtlib/fmt/issues/145>`_, 3255 `#146 <https://github.com/fmtlib/fmt/issues/146>`_, 3256 `#158 <https://github.com/fmtlib/fmt/issues/158>`_, 3257 `#163 <https://github.com/fmtlib/fmt/issues/163>`_, 3258 `#175 <https://github.com/fmtlib/fmt/issues/175>`_, 3259 `#190 <https://github.com/fmtlib/fmt/issues/190>`_, 3260 `#191 <https://github.com/fmtlib/fmt/pull/191>`_, 3261 `#194 <https://github.com/fmtlib/fmt/issues/194>`_, 3262 `#196 <https://github.com/fmtlib/fmt/pull/196>`_, 3263 `#216 <https://github.com/fmtlib/fmt/issues/216>`_, 3264 `#218 <https://github.com/fmtlib/fmt/pull/218>`_, 3265 `#220 <https://github.com/fmtlib/fmt/pull/220>`_, 3266 `#229 <https://github.com/fmtlib/fmt/pull/229>`_, 3267 `#233 <https://github.com/fmtlib/fmt/issues/233>`_, 3268 `#234 <https://github.com/fmtlib/fmt/issues/234>`_, 3269 `#236 <https://github.com/fmtlib/fmt/pull/236>`_, 3270 `#281 <https://github.com/fmtlib/fmt/issues/281>`_, 3271 `#289 <https://github.com/fmtlib/fmt/issues/289>`_). 3272 Thanks to `@seanmiddleditch (Sean Middleditch) <https://github.com/seanmiddleditch>`_, 3273 `@dixlorenz (Dix Lorenz) <https://github.com/dixlorenz>`_, 3274 `@CarterLi (李通洲) <https://github.com/CarterLi>`_, 3275 `@Naios <https://github.com/Naios>`_, 3276 `@fmatthew5876 (Matthew Fioravante) <https://github.com/fmatthew5876>`_, 3277 `@LevskiWeng (Levski Weng) <https://github.com/LevskiWeng>`_, 3278 `@rpopescu <https://github.com/rpopescu>`_, 3279 `@gabime (Gabi Melman) <https://github.com/gabime>`_, 3280 `@cubicool (Jeremy Moles) <https://github.com/cubicool>`_, 3281 `@jkflying (Julian Kent) <https://github.com/jkflying>`_, 3282 `@LogicalKnight (Sean L) <https://github.com/LogicalKnight>`_, 3283 `@inguin (Ingo van Lil) <https://github.com/inguin>`_ and 3284 `@Jopie64 (Johan) <https://github.com/Jopie64>`_. 3285 3286* Fixed portability issues (mostly causing test failures) on ARM, ppc64, ppc64le, 3287 s390x and SunOS 5.11 i386 3288 (`#138 <https://github.com/fmtlib/fmt/issues/138>`_, 3289 `#179 <https://github.com/fmtlib/fmt/issues/179>`_, 3290 `#180 <https://github.com/fmtlib/fmt/issues/180>`_, 3291 `#202 <https://github.com/fmtlib/fmt/issues/202>`_, 3292 `#225 <https://github.com/fmtlib/fmt/issues/225>`_, 3293 `Red Hat Bugzilla Bug 1260297 <https://bugzilla.redhat.com/show_bug.cgi?id=1260297>`_). 3294 Thanks to `@Naios <https://github.com/Naios>`_, 3295 `@jackyf (Eugene V. Lyubimkin) <https://github.com/jackyf>`_ and Dave Johansen. 3296 3297* Fixed a name conflict with macro ``free`` defined in 3298 ``crtdbg.h`` when ``_CRTDBG_MAP_ALLOC`` is set 3299 (`#211 <https://github.com/fmtlib/fmt/issues/211>`_). 3300 3301* Fixed shared library build on OS X 3302 (`#212 <https://github.com/fmtlib/fmt/pull/212>`_). 3303 Thanks to `@dean0x7d (Dean Moldovan) <https://github.com/dean0x7d>`_. 3304 3305* Fixed an overload conflict on MSVC when ``/Zc:wchar_t-`` option is specified 3306 (`#214 <https://github.com/fmtlib/fmt/pull/214>`_). 3307 Thanks to `@slavanap (Vyacheslav Napadovsky) <https://github.com/slavanap>`_. 3308 3309* Improved compatibility with MSVC 2008 3310 (`#236 <https://github.com/fmtlib/fmt/pull/236>`_). 3311 Thanks to `@Jopie64 (Johan) <https://github.com/Jopie64>`_. 3312 3313* Improved compatibility with bcc32 3314 (`#227 <https://github.com/fmtlib/fmt/issues/227>`_). 3315 3316* Fixed ``static_assert`` detection on Clang 3317 (`#228 <https://github.com/fmtlib/fmt/pull/228>`_). 3318 Thanks to `@dean0x7d (Dean Moldovan) <https://github.com/dean0x7d>`_. 3319 33201.1.0 - 2015-03-06 3321------------------ 3322 3323* Added ``BasicArrayWriter``, a class template that provides operations for 3324 formatting and writing data into a fixed-size array 3325 (`#105 <https://github.com/fmtlib/fmt/issues/105>`_ and 3326 `#122 <https://github.com/fmtlib/fmt/issues/122>`_): 3327 3328 .. code:: c++ 3329 3330 char buffer[100]; 3331 fmt::ArrayWriter w(buffer); 3332 w.write("The answer is {}", 42); 3333 3334* Added `0 A.D. <http://play0ad.com/>`_ and `PenUltima Online (POL) 3335 <http://www.polserver.com/>`_ to the list of notable projects using C++ Format. 3336 3337* C++ Format now uses MSVC intrinsics for better formatting performance 3338 (`#115 <https://github.com/fmtlib/fmt/pull/115>`_, 3339 `#116 <https://github.com/fmtlib/fmt/pull/116>`_, 3340 `#118 <https://github.com/fmtlib/fmt/pull/118>`_ and 3341 `#121 <https://github.com/fmtlib/fmt/pull/121>`_). 3342 Previously these optimizations where only used on GCC and Clang. 3343 Thanks to `@CarterLi <https://github.com/CarterLi>`_ and 3344 `@objectx <https://github.com/objectx>`_. 3345 3346* CMake install target (`#119 <https://github.com/fmtlib/fmt/pull/119>`_). 3347 Thanks to `@TrentHouliston <https://github.com/TrentHouliston>`_. 3348 3349 You can now install C++ Format with ``make install`` command. 3350 3351* Improved `Biicode <http://www.biicode.com/>`_ support 3352 (`#98 <https://github.com/fmtlib/fmt/pull/98>`_ and 3353 `#104 <https://github.com/fmtlib/fmt/pull/104>`_). Thanks to 3354 `@MariadeAnton <https://github.com/MariadeAnton>`_ and 3355 `@franramirez688 <https://github.com/franramirez688>`_. 3356 3357* Improved support for building with `Android NDK 3358 <https://developer.android.com/tools/sdk/ndk/index.html>`_ 3359 (`#107 <https://github.com/fmtlib/fmt/pull/107>`_). 3360 Thanks to `@newnon <https://github.com/newnon>`_. 3361 3362 The `android-ndk-example <https://github.com/fmtlib/android-ndk-example>`_ 3363 repository provides and example of using C++ Format with Android NDK: 3364 3365 .. image:: https://raw.githubusercontent.com/fmtlib/android-ndk-example/ 3366 master/screenshot.png 3367 3368* Improved documentation of ``SystemError`` and ``WindowsError`` 3369 (`#54 <https://github.com/fmtlib/fmt/issues/54>`_). 3370 3371* Various code improvements 3372 (`#110 <https://github.com/fmtlib/fmt/pull/110>`_, 3373 `#111 <https://github.com/fmtlib/fmt/pull/111>`_ 3374 `#112 <https://github.com/fmtlib/fmt/pull/112>`_). 3375 Thanks to `@CarterLi <https://github.com/CarterLi>`_. 3376 3377* Improved compile-time errors when formatting wide into narrow strings 3378 (`#117 <https://github.com/fmtlib/fmt/issues/117>`_). 3379 3380* Fixed ``BasicWriter::write`` without formatting arguments when C++11 support 3381 is disabled (`#109 <https://github.com/fmtlib/fmt/issues/109>`_). 3382 3383* Fixed header-only build on OS X with GCC 4.9 3384 (`#124 <https://github.com/fmtlib/fmt/issues/124>`_). 3385 3386* Fixed packaging issues (`#94 <https://github.com/fmtlib/fmt/issues/94>`_). 3387 3388* Added `changelog <https://github.com/fmtlib/fmt/blob/master/ChangeLog.rst>`_ 3389 (`#103 <https://github.com/fmtlib/fmt/issues/103>`_). 3390 33911.0.0 - 2015-02-05 3392------------------ 3393 3394* Add support for a header-only configuration when ``FMT_HEADER_ONLY`` is 3395 defined before including ``format.h``: 3396 3397 .. code:: c++ 3398 3399 #define FMT_HEADER_ONLY 3400 #include "format.h" 3401 3402* Compute string length in the constructor of ``BasicStringRef`` 3403 instead of the ``size`` method 3404 (`#79 <https://github.com/fmtlib/fmt/issues/79>`_). 3405 This eliminates size computation for string literals on reasonable optimizing 3406 compilers. 3407 3408* Fix formatting of types with overloaded ``operator <<`` for ``std::wostream`` 3409 (`#86 <https://github.com/fmtlib/fmt/issues/86>`_): 3410 3411 .. code:: c++ 3412 3413 fmt::format(L"The date is {0}", Date(2012, 12, 9)); 3414 3415* Fix linkage of tests on Arch Linux 3416 (`#89 <https://github.com/fmtlib/fmt/issues/89>`_). 3417 3418* Allow precision specifier for non-float arguments 3419 (`#90 <https://github.com/fmtlib/fmt/issues/90>`_): 3420 3421 .. code:: c++ 3422 3423 fmt::print("{:.3}\n", "Carpet"); // prints "Car" 3424 3425* Fix build on Android NDK 3426 (`#93 <https://github.com/fmtlib/fmt/issues/93>`_) 3427 3428* Improvements to documentation build procedure. 3429 3430* Remove ``FMT_SHARED`` CMake variable in favor of standard `BUILD_SHARED_LIBS 3431 <http://www.cmake.org/cmake/help/v3.0/variable/BUILD_SHARED_LIBS.html>`_. 3432 3433* Fix error handling in ``fmt::fprintf``. 3434 3435* Fix a number of warnings. 3436 34370.12.0 - 2014-10-25 3438------------------- 3439 3440* [Breaking] Improved separation between formatting and buffer management. 3441 ``Writer`` is now a base class that cannot be instantiated directly. 3442 The new ``MemoryWriter`` class implements the default buffer management 3443 with small allocations done on stack. So ``fmt::Writer`` should be replaced 3444 with ``fmt::MemoryWriter`` in variable declarations. 3445 3446 Old code: 3447 3448 .. code:: c++ 3449 3450 fmt::Writer w; 3451 3452 New code: 3453 3454 .. code:: c++ 3455 3456 fmt::MemoryWriter w; 3457 3458 If you pass ``fmt::Writer`` by reference, you can continue to do so: 3459 3460 .. code:: c++ 3461 3462 void f(fmt::Writer &w); 3463 3464 This doesn't affect the formatting API. 3465 3466* Support for custom memory allocators 3467 (`#69 <https://github.com/fmtlib/fmt/issues/69>`_) 3468 3469* Formatting functions now accept `signed char` and `unsigned char` strings as 3470 arguments (`#73 <https://github.com/fmtlib/fmt/issues/73>`_): 3471 3472 .. code:: c++ 3473 3474 auto s = format("GLSL version: {}", glGetString(GL_VERSION)); 3475 3476* Reduced code bloat. According to the new `benchmark results 3477 <https://github.com/fmtlib/fmt#compile-time-and-code-bloat>`_, 3478 cppformat is close to ``printf`` and by the order of magnitude better than 3479 Boost Format in terms of compiled code size. 3480 3481* Improved appearance of the documentation on mobile by using the `Sphinx 3482 Bootstrap theme <http://ryan-roemer.github.io/sphinx-bootstrap-theme/>`_: 3483 3484 .. |old| image:: https://cloud.githubusercontent.com/assets/576385/4792130/ 3485 cd256436-5de3-11e4-9a62-c077d0c2b003.png 3486 3487 .. |new| image:: https://cloud.githubusercontent.com/assets/576385/4792131/ 3488 cd29896c-5de3-11e4-8f59-cac952942bf0.png 3489 3490 +-------+-------+ 3491 | Old | New | 3492 +-------+-------+ 3493 | |old| | |new| | 3494 +-------+-------+ 3495 34960.11.0 - 2014-08-21 3497------------------- 3498 3499* Safe printf implementation with a POSIX extension for positional arguments: 3500 3501 .. code:: c++ 3502 3503 fmt::printf("Elapsed time: %.2f seconds", 1.23); 3504 fmt::printf("%1$s, %3$d %2$s", weekday, month, day); 3505 3506* Arguments of ``char`` type can now be formatted as integers 3507 (Issue `#55 <https://github.com/fmtlib/fmt/issues/55>`_): 3508 3509 .. code:: c++ 3510 3511 fmt::format("0x{0:02X}", 'a'); 3512 3513* Deprecated parts of the API removed. 3514 3515* The library is now built and tested on MinGW with Appveyor in addition to 3516 existing test platforms Linux/GCC, OS X/Clang, Windows/MSVC. 3517 35180.10.0 - 2014-07-01 3519------------------- 3520 3521**Improved API** 3522 3523* All formatting methods are now implemented as variadic functions instead 3524 of using ``operator<<`` for feeding arbitrary arguments into a temporary 3525 formatter object. This works both with C++11 where variadic templates are 3526 used and with older standards where variadic functions are emulated by 3527 providing lightweight wrapper functions defined with the ``FMT_VARIADIC`` 3528 macro. You can use this macro for defining your own portable variadic 3529 functions: 3530 3531 .. code:: c++ 3532 3533 void report_error(const char *format, const fmt::ArgList &args) { 3534 fmt::print("Error: {}"); 3535 fmt::print(format, args); 3536 } 3537 FMT_VARIADIC(void, report_error, const char *) 3538 3539 report_error("file not found: {}", path); 3540 3541 Apart from a more natural syntax, this also improves performance as there 3542 is no need to construct temporary formatter objects and control arguments' 3543 lifetimes. Because the wrapper functions are very lightweight, this doesn't 3544 cause code bloat even in pre-C++11 mode. 3545 3546* Simplified common case of formatting an ``std::string``. Now it requires a 3547 single function call: 3548 3549 .. code:: c++ 3550 3551 std::string s = format("The answer is {}.", 42); 3552 3553 Previously it required 2 function calls: 3554 3555 .. code:: c++ 3556 3557 std::string s = str(Format("The answer is {}.") << 42); 3558 3559 Instead of unsafe ``c_str`` function, ``fmt::Writer`` should be used directly 3560 to bypass creation of ``std::string``: 3561 3562 .. code:: c++ 3563 3564 fmt::Writer w; 3565 w.write("The answer is {}.", 42); 3566 w.c_str(); // returns a C string 3567 3568 This doesn't do dynamic memory allocation for small strings and is less error 3569 prone as the lifetime of the string is the same as for ``std::string::c_str`` 3570 which is well understood (hopefully). 3571 3572* Improved consistency in naming functions that are a part of the public API. 3573 Now all public functions are lowercase following the standard library 3574 conventions. Previously it was a combination of lowercase and 3575 CapitalizedWords. 3576 Issue `#50 <https://github.com/fmtlib/fmt/issues/50>`_. 3577 3578* Old functions are marked as deprecated and will be removed in the next 3579 release. 3580 3581**Other Changes** 3582 3583* Experimental support for printf format specifications (work in progress): 3584 3585 .. code:: c++ 3586 3587 fmt::printf("The answer is %d.", 42); 3588 std::string s = fmt::sprintf("Look, a %s!", "string"); 3589 3590* Support for hexadecimal floating point format specifiers ``a`` and ``A``: 3591 3592 .. code:: c++ 3593 3594 print("{:a}", -42.0); // Prints -0x1.5p+5 3595 print("{:A}", -42.0); // Prints -0X1.5P+5 3596 3597* CMake option ``FMT_SHARED`` that specifies whether to build format as a 3598 shared library (off by default). 3599 36000.9.0 - 2014-05-13 3601------------------ 3602 3603* More efficient implementation of variadic formatting functions. 3604 3605* ``Writer::Format`` now has a variadic overload: 3606 3607 .. code:: c++ 3608 3609 Writer out; 3610 out.Format("Look, I'm {}!", "variadic"); 3611 3612* For efficiency and consistency with other overloads, variadic overload of 3613 the ``Format`` function now returns ``Writer`` instead of ``std::string``. 3614 Use the ``str`` function to convert it to ``std::string``: 3615 3616 .. code:: c++ 3617 3618 std::string s = str(Format("Look, I'm {}!", "variadic")); 3619 3620* Replaced formatter actions with output sinks: ``NoAction`` -> ``NullSink``, 3621 ``Write`` -> ``FileSink``, ``ColorWriter`` -> ``ANSITerminalSink``. 3622 This improves naming consistency and shouldn't affect client code unless 3623 these classes are used directly which should be rarely needed. 3624 3625* Added ``ThrowSystemError`` function that formats a message and throws 3626 ``SystemError`` containing the formatted message and system-specific error 3627 description. For example, the following code 3628 3629 .. code:: c++ 3630 3631 FILE *f = fopen(filename, "r"); 3632 if (!f) 3633 ThrowSystemError(errno, "Failed to open file '{}'") << filename; 3634 3635 will throw ``SystemError`` exception with description 3636 "Failed to open file '<filename>': No such file or directory" if file 3637 doesn't exist. 3638 3639* Support for AppVeyor continuous integration platform. 3640 3641* ``Format`` now throws ``SystemError`` in case of I/O errors. 3642 3643* Improve test infrastructure. Print functions are now tested by redirecting 3644 the output to a pipe. 3645 36460.8.0 - 2014-04-14 3647------------------ 3648 3649* Initial release 3650