blob: 9c171af0505955ecabd835f76d1a48ed2c17c9d8 [file] [log] [blame]
Victor Zverovich7bdf0622020-11-24 17:15:02 -080017.1.3 - 2020-11-24
2------------------
Victor Zverovicha2fa5d62020-11-23 10:35:07 -08003
Victor Zverovich6ce207b2020-11-24 08:29:17 -08004* Fixed handling of buffer boundaries in ``format_to_n``
Victor Zverovich07b1c1a2020-11-24 08:24:14 -08005 (`#1996 <https://github.com/fmtlib/fmt/issues/1996>`_,
6 `#2029 <https://github.com/fmtlib/fmt/issues/2029>`_).
Victor Zverovicha2fa5d62020-11-23 10:35:07 -08007
8* Fixed linkage errors when linking with a shared library
9 (`#2011 <https://github.com/fmtlib/fmt/issues/2011>`_).
10
Victor Zverovichfc135512020-11-24 17:14:00 -080011* Reintroduced ostream support to range formatters
Victor Zverovich07b1c1a2020-11-24 08:24:14 -080012 (`#2014 <https://github.com/fmtlib/fmt/issues/2014>`_).
13
Victor Zverovichfc135512020-11-24 17:14:00 -080014* Worked around an issue with mixing std versions in gcc
Victor Zverovich07b1c1a2020-11-24 08:24:14 -080015 (`#2017 <https://github.com/fmtlib/fmt/issues/2017>`_).
16
Victor Zverovichcc09f1a2020-11-04 06:50:09 -0800177.1.2 - 2020-11-04
18------------------
Victor Zveroviche4eb2422020-11-03 21:20:53 -080019
20* Fixed floating point formatting with large precision
21 (`#1976 <https://github.com/fmtlib/fmt/issues/1976>`_).
22
Victor Zverovich5f7f7b92020-11-01 06:30:39 -0800237.1.1 - 2020-11-01
24------------------
Victor Zverovich5d3f0742020-11-01 06:21:00 -080025
26* Fixed ABI compatibility with 7.0.x
27 (`#1961 <https://github.com/fmtlib/fmt/issues/1961>`_).
28
29* Added the ``FMT_ARM_ABI_COMPATIBILITY`` macro to work around ABI
30 incompatibility between GCC and Clang on ARM
31 (`#1919 <https://github.com/fmtlib/fmt/issues/1919>`_).
32
33* Worked around a SFINAE bug in GCC 8
34 (`#1957 <https://github.com/fmtlib/fmt/issues/1957>`_).
35
36* Fixed linkage errors when building with GCC's LTO
37 (`#1955 <https://github.com/fmtlib/fmt/issues/1955>`_).
38
39* Fixed a compilation error when building without ``__builtin_clz`` or equivalent
40 (`#1968 <https://github.com/fmtlib/fmt/pull/1968>`_).
41 Thanks `@tohammer (Tobias Hammer) <https://github.com/tohammer>`_.
42
43* Fixed a sign conversion warning
44 (`#1964 <https://github.com/fmtlib/fmt/pull/1964>`_).
45 Thanks `@OptoCloud <https://github.com/OptoCloud>`_.
46
Victor Zverovich4fe0b112020-10-25 10:44:22 -0700477.1.0 - 2020-10-25
48------------------
Victor Zverovichda8278e2020-10-19 14:37:14 -070049
Victor Zverovich62c72052020-10-25 08:56:46 -070050* Switched from `Grisu3
51 <https://www.cs.tufts.edu/~nr/cs257/archive/florian-loitsch/printf.pdf>`_
52 to `Dragonbox <https://github.com/jk-jeon/dragonbox>`_ for the default
53 floating-point formatting which gives the shortest decimal representation
54 with round-trip guarantee and correct rounding
Victor Zverovich740385d2020-10-24 11:18:33 -070055 (`#1882 <https://github.com/fmtlib/fmt/pull/1882>`_,
56 `#1887 <https://github.com/fmtlib/fmt/pull/1887>`_,
57 `#1894 <https://github.com/fmtlib/fmt/pull/1894>`_). This makes {fmt} up to
58 20-30x faster than common implementations of ``std::ostringstream`` and
59 ``sprintf`` on `dtoa-benchmark <https://github.com/fmtlib/dtoa-benchmark>`_
Victor Zverovich62c72052020-10-25 08:56:46 -070060 and faster than double-conversion and Ryƫ:
Victor Zverovich740385d2020-10-24 11:18:33 -070061
62 .. image:: https://user-images.githubusercontent.com/576385/
63 95684665-11719600-0ba8-11eb-8e5b-972ff4e49428.png
64
65 It is possible to get even better performance at the cost of larger binary
66 size by compiling with the ``FMT_USE_FULL_CACHE_DRAGONBOX`` macro set to 1.
67
68 Thanks `@jk-jeon (Junekey Jeon) <https://github.com/jk-jeon>`_.
69
70* Added an experimental unsynchronized file output API which, together with
Victor Zverovich62c72052020-10-25 08:56:46 -070071 `format string compilation <https://fmt.dev/latest/api.html#compile-api>`_,
72 can give `5-9 times speed up compared to fprintf
73 <https://www.zverovich.net/2020/08/04/optimal-file-buffer-size.html>`_
Victor Zverovich740385d2020-10-24 11:18:33 -070074 on common platforms (`godbolt <https://godbolt.org/z/nsTcG8>`__):
75
76 .. code:: c++
77
78 #include <fmt/os.h>
79
80 int main() {
81 auto f = fmt::output_file("guide");
82 f.print("The answer is {}.", 42);
83 }
84
85* Added a formatter for ``std::chrono::time_point<system_clock>``
Victor Zverovichc10e3f72020-10-25 07:29:24 -070086 (`#1819 <https://github.com/fmtlib/fmt/issues/1819>`_,
87 `#1837 <https://github.com/fmtlib/fmt/pull/1837>`_). For example
Victor Zverovich740385d2020-10-24 11:18:33 -070088 (`godbolt <https://godbolt.org/z/c4M6fh>`__):
Victor Zverovichcd465112020-10-24 09:24:47 -070089
90 .. code:: c++
91
92 #include <fmt/chrono.h>
93
94 int main() {
95 auto now = std::chrono::system_clock::now();
96 fmt::print("The time is {:%H:%M:%S}.\n", now);
97 }
98
99 Thanks `@adamburgess (Adam Burgess) <https://github.com/adamburgess>`_.
100
Victor Zverovichcd465112020-10-24 09:24:47 -0700101* Added support for ranges with non-const ``begin``/``end`` to ``fmt::join``
Victor Zveroviche542e692020-10-25 06:46:45 -0700102 (`#1784 <https://github.com/fmtlib/fmt/issues/1784>`_,
103 `#1786 <https://github.com/fmtlib/fmt/pull/1786>`_). For example
Victor Zverovich740385d2020-10-24 11:18:33 -0700104 (`godbolt <https://godbolt.org/z/jP63Tv>`__):
Victor Zverovichcd465112020-10-24 09:24:47 -0700105
106 .. code:: c++
107
108 #include <fmt/ranges.h>
109 #include <range/v3/view/filter.hpp>
110
111 int main() {
112 using std::literals::string_literals::operator""s;
113 auto strs = std::array{"a"s, "bb"s, "ccc"s};
114 auto range = strs | ranges::views::filter(
115 [] (const std::string &x) { return x.size() != 2; }
116 );
117 fmt::print("{}\n", fmt::join(range, ""));
118 }
119
120 prints "accc".
121
122 Thanks `@tonyelewis (Tony E Lewis) <https://github.com/tonyelewis>`_.
123
124* Added a ``memory_buffer::append`` overload that takes a range
Victor Zveroviche542e692020-10-25 06:46:45 -0700125 (`#1806 <https://github.com/fmtlib/fmt/pull/1806>`_).
Victor Zverovichcd465112020-10-24 09:24:47 -0700126 Thanks `@BRevzin (Barry Revzin) <https://github.com/BRevzin>`_.
127
Victor Zverovich50247422020-10-22 09:27:49 -0700128* Improved handling of single code units in ``FMT_COMPILE``. For example:
Victor Zverovich0452a4e2020-10-22 09:08:30 -0700129
130 .. code:: c++
131
132 #include <fmt/compile.h>
133
134 char* f(char* buf) {
135 return fmt::format_to(buf, FMT_COMPILE("x{}"), 42);
136 }
137
138 compiles to just (`godbolt <https://godbolt.org/z/5vncz3>`__):
139
140 .. code:: asm
141
142 _Z1fPc:
143 movb $120, (%rdi)
144 xorl %edx, %edx
145 cmpl $42, _ZN3fmt2v76detail10basic_dataIvE23zero_or_powers_of_10_32E+8(%rip)
146 movl $3, %eax
147 seta %dl
148 subl %edx, %eax
149 movzwl _ZN3fmt2v76detail10basic_dataIvE6digitsE+84(%rip), %edx
150 cltq
151 addq %rdi, %rax
152 movw %dx, -2(%rax)
153 ret
154
Victor Zverovich46291be2020-10-23 07:38:01 -0700155 Here a single ``mov`` instruction writes ``'x'`` (``$120``) to the output
156 buffer.
Victor Zverovich0452a4e2020-10-22 09:08:30 -0700157
Victor Zverovichcd465112020-10-24 09:24:47 -0700158* Added dynamic width support to format string compilation
Victor Zveroviche542e692020-10-25 06:46:45 -0700159 (`#1809 <https://github.com/fmtlib/fmt/issues/1809>`_).
Victor Zverovichcd465112020-10-24 09:24:47 -0700160
Victor Zverovich0452a4e2020-10-22 09:08:30 -0700161* Improved error reporting for unformattable types: now you'll get the type name
162 directly in the error message instead of the note:
163
164 .. code:: c++
165
166 #include <fmt/core.h>
167
168 struct how_about_no {};
169
170 int main() {
171 fmt::print("{}", how_about_no());
172 }
173
174 Error (`godbolt <https://godbolt.org/z/GoxM4e>`__):
175
Victor Zverovich39bde322020-10-25 09:19:38 -0700176 ``fmt/core.h:1438:3: error: static_assert failed due to requirement
Victor Zverovich204d2992020-10-25 09:12:22 -0700177 'fmt::v7::formattable<how_about_no>()' "Cannot format an argument.
178 To make type T formattable provide a formatter<T> specialization:
179 https://fmt.dev/latest/api.html#udt"
Victor Zverovich39bde322020-10-25 09:19:38 -0700180 ...``
Victor Zverovich0452a4e2020-10-22 09:08:30 -0700181
Victor Zveroviche542e692020-10-25 06:46:45 -0700182* Added the `make_args_checked <https://fmt.dev/7.1.0/api.html#argument-lists>`_
Victor Zverovich46291be2020-10-23 07:38:01 -0700183 function template that allows you to write formatting functions with
Victor Zverovich62c72052020-10-25 08:56:46 -0700184 compile-time format string checks and avoid binary code bloat
Victor Zverovichcd465112020-10-24 09:24:47 -0700185 (`godbolt <https://godbolt.org/z/PEf9qr>`__):
Victor Zverovich46291be2020-10-23 07:38:01 -0700186
187 .. code:: c++
188
189 void vlog(const char* file, int line, fmt::string_view format,
190 fmt::format_args args) {
191 fmt::print("{}: {}: ", file, line);
192 fmt::vprint(format, args);
193 }
194
195 template <typename S, typename... Args>
196 void log(const char* file, int line, const S& format, Args&&... args) {
197 vlog(file, line, format,
198 fmt::make_args_checked<Args...>(format, args...));
199 }
200
201 #define MY_LOG(format, ...) \
202 log(__FILE__, __LINE__, FMT_STRING(format), __VA_ARGS__)
203
204 MY_LOG("invalid squishiness: {}", 42);
205
Victor Zverovich740385d2020-10-24 11:18:33 -0700206* Replaced ``snprintf`` fallback with a faster internal IEEE 754 ``float`` and
207 ``double`` formatter for arbitrary precision. For example
208 (`godbolt <https://godbolt.org/z/dPhWvj>`__):
209
210 .. code:: c++
211
212 #include <fmt/core.h>
213
214 int main() {
215 fmt::print("{:.500}\n", 4.9406564584124654E-324);
216 }
217
Victor Zverovich62c72052020-10-25 08:56:46 -0700218 prints
219
220 ``4.9406564584124654417656879286822137236505980261432476442558568250067550727020875186529983636163599237979656469544571773092665671035593979639877479601078187812630071319031140452784581716784898210368871863605699873072305000638740915356498438731247339727316961514003171538539807412623856559117102665855668676818703956031062493194527159149245532930545654440112748012970999954193198940908041656332452475714786901472678015935523861155013480352649347201937902681071074917033322268447533357208324319360923829e-324``.
Victor Zverovich740385d2020-10-24 11:18:33 -0700221
Victor Zverovichcd465112020-10-24 09:24:47 -0700222* Made ``format_to_n`` and ``formatted_size`` part of the `core API
223 <https://fmt.dev/latest/api.html#core-api>`__
Victor Zverovich62c72052020-10-25 08:56:46 -0700224 (`godbolt <https://godbolt.org/z/sPjY1K>`__):
Victor Zverovichcd465112020-10-24 09:24:47 -0700225
226 .. code:: c++
227
228 #include <fmt/core.h>
229
230 int main() {
Victor Zverovich62c72052020-10-25 08:56:46 -0700231 char buffer[10];
232 auto result = fmt::format_to_n(buffer, sizeof(buffer), "{}", 42);
Victor Zverovichcd465112020-10-24 09:24:47 -0700233 }
234
Victor Zverovich740385d2020-10-24 11:18:33 -0700235* Added ``fmt::format_to_n`` overload with format string compilation
236 (`#1764 <https://github.com/fmtlib/fmt/issues/1764>`_,
237 `#1767 <https://github.com/fmtlib/fmt/pull/1767>`_,
238 `#1869 <https://github.com/fmtlib/fmt/pull/1869>`_). For example
Victor Zverovich62c72052020-10-25 08:56:46 -0700239 (`godbolt <https://godbolt.org/z/93h86q>`__):
Victor Zverovich740385d2020-10-24 11:18:33 -0700240
241 .. code:: c++
242
243 #include <fmt/compile.h>
244
245 int main() {
Victor Zverovich62c72052020-10-25 08:56:46 -0700246 char buffer[8];
247 fmt::format_to_n(buffer, sizeof(buffer), FMT_COMPILE("{}"), 42);
Victor Zverovich740385d2020-10-24 11:18:33 -0700248 }
249
250 Thanks `@Kurkin (Dmitry Kurkin) <https://github.com/Kurkin>`_,
251 `@alexezeder (Alexey Ochapov) <https://github.com/alexezeder>`_.
252
253* Added ``fmt::format_to`` overload that take ``text_style``
254 (`#1593 <https://github.com/fmtlib/fmt/issues/1593>`_,
255 `#1842 <https://github.com/fmtlib/fmt/issues/1842>`_,
256 `#1843 <https://github.com/fmtlib/fmt/pull/1843>`_). For example
257 (`godbolt <https://godbolt.org/z/91153r>`__):
258
259 .. code:: c++
260
261 #include <fmt/color.h>
262
263 int main() {
264 std::string out;
265 fmt::format_to(std::back_inserter(out),
266 fmt::emphasis::bold | fg(fmt::color::red),
267 "The answer is {}.", 42);
268 }
269
270 Thanks `@Naios (Denis Blank) <https://github.com/Naios>`_.
271
Victor Zverovich6a77ea32020-10-25 08:59:36 -0700272* Made the ``#`` specifier emit trailing zeros in addition to the decimal point
Victor Zverovichc10e3f72020-10-25 07:29:24 -0700273 (`#1797 <https://github.com/fmtlib/fmt/issues/1797>`_). For example
Victor Zverovichcd465112020-10-24 09:24:47 -0700274 (`godbolt <https://godbolt.org/z/bhdcW9>`__):
275
276 .. code:: c++
277
278 #include <fmt/core.h>
279
280 int main() {
281 fmt::print("{:#.2g}", 0.5);
282 }
283
Victor Zverovich6a77ea32020-10-25 08:59:36 -0700284 prints ``0.50``.
Victor Zverovichcd465112020-10-24 09:24:47 -0700285
Victor Zverovichc10e3f72020-10-25 07:29:24 -0700286* Changed the default floating point format to not include ``.0`` for
287 consistency with ``std::format`` and ``std::to_chars``
288 (`#1893 <https://github.com/fmtlib/fmt/issues/1893>`_,
289 `#1943 <https://github.com/fmtlib/fmt/issues/1943>`_). It is possible to get
290 the decimal point and trailing zero with the ``#`` specifier.
291
292* Fixed an issue with floating-point formatting that could result in addition of
293 a non-significant trailing zero in rare cases e.g. ``1.00e-34`` instead of
294 ``1.0e-34`` (`#1873 <https://github.com/fmtlib/fmt/issues/1873>`_,
Victor Zverovich62c72052020-10-25 08:56:46 -0700295 `#1917 <https://github.com/fmtlib/fmt/issues/1917>`_).
Victor Zverovichc10e3f72020-10-25 07:29:24 -0700296
Victor Zverovichcd465112020-10-24 09:24:47 -0700297* Made ``fmt::to_string`` fallback on ``ostream`` insertion operator if
298 the ``formatter`` specialization is not provided
299 (`#1815 <https://github.com/fmtlib/fmt/issues/1815>`_,
300 `#1829 <https://github.com/fmtlib/fmt/pull/1829>`_).
301 Thanks `@alexezeder (Alexey Ochapov) <https://github.com/alexezeder>`_.
302
Victor Zverovich740385d2020-10-24 11:18:33 -0700303* Added support for the append mode to the experimental file API and
304 improved ``fcntl.h`` detection.
305 (`#1847 <https://github.com/fmtlib/fmt/pull/1847>`_,
306 `#1848 <https://github.com/fmtlib/fmt/pull/1848>`_).
Victor Zverovichcd465112020-10-24 09:24:47 -0700307 Thanks `@t-wiser <https://github.com/t-wiser>`_.
308
Victor Zverovich0452a4e2020-10-22 09:08:30 -0700309* Fixed handling of types that have both an implicit conversion operator and
Victor Zverovich62c72052020-10-25 08:56:46 -0700310 an overloaded ``ostream`` insertion operator
Victor Zverovich0452a4e2020-10-22 09:08:30 -0700311 (`#1766 <https://github.com/fmtlib/fmt/issues/1766>`_).
312
Victor Zverovichcd465112020-10-24 09:24:47 -0700313* Fixed a slicing issue in an internal iterator type
314 (`#1822 <https://github.com/fmtlib/fmt/pull/1822>`_).
315 Thanks `@BRevzin (Barry Revzin) <https://github.com/BRevzin>`_.
316
Victor Zveroviche542e692020-10-25 06:46:45 -0700317* Fixed an issue in locale-specific integer formatting
318 (`#1927 <https://github.com/fmtlib/fmt/issues/1927>`_).
319
320* Fixed handling of exotic code unit types
Victor Zverovichc10e3f72020-10-25 07:29:24 -0700321 (`#1870 <https://github.com/fmtlib/fmt/issues/1870>`_,
322 `#1932 <https://github.com/fmtlib/fmt/issues/1932>`_).
Victor Zveroviche542e692020-10-25 06:46:45 -0700323
Victor Zverovich740385d2020-10-24 11:18:33 -0700324* Improved ``FMT_ALWAYS_INLINE``
Victor Zveroviche542e692020-10-25 06:46:45 -0700325 (`#1878 <https://github.com/fmtlib/fmt/pull/1878>`_).
Victor Zverovich740385d2020-10-24 11:18:33 -0700326 Thanks `@jk-jeon (Junekey Jeon) <https://github.com/jk-jeon>`_.
327
Victor Zveroviche542e692020-10-25 06:46:45 -0700328* Removed dependency on ``windows.h``
329 (`#1900 <https://github.com/fmtlib/fmt/pull/1900>`_).
330 Thanks `@bernd5 (Bernd Baumanns) <https://github.com/bernd5>`_.
331
Victor Zverovich740385d2020-10-24 11:18:33 -0700332* Optimized counting of decimal digits on MSVC
Victor Zveroviche542e692020-10-25 06:46:45 -0700333 (`#1890 <https://github.com/fmtlib/fmt/pull/1890>`_).
Victor Zverovich740385d2020-10-24 11:18:33 -0700334 Thanks `@mwinterb <https://github.com/mwinterb>`_.
335
Victor Zverovich46291be2020-10-23 07:38:01 -0700336* Improved documentation
Victor Zveroviche542e692020-10-25 06:46:45 -0700337 (`#1772 <https://github.com/fmtlib/fmt/issues/1772>`_,
338 `#1775 <https://github.com/fmtlib/fmt/pull/1775>`_,
339 `#1792 <https://github.com/fmtlib/fmt/pull/1792>`_,
340 `#1838 <https://github.com/fmtlib/fmt/pull/1838>`_,
341 `#1888 <https://github.com/fmtlib/fmt/pull/1888>`_,
Victor Zverovich62c72052020-10-25 08:56:46 -0700342 `#1918 <https://github.com/fmtlib/fmt/pull/1918>`_,
343 `#1939 <https://github.com/fmtlib/fmt/pull/1939>`_).
Victor Zverovichcd465112020-10-24 09:24:47 -0700344 Thanks `@leolchat (LĂ©onard GĂ©rard) <https://github.com/leolchat>`_,
345 `@pepsiman (Malcolm Parsons) <https://github.com/pepsiman>`_,
Victor Zverovich740385d2020-10-24 11:18:33 -0700346 `@Klaim (Joël Lamotte) <https://github.com/Klaim>`_,
Victor Zveroviche542e692020-10-25 06:46:45 -0700347 `@ravijanjam (Ravi J) <https://github.com/ravijanjam>`_,
348 `@francesco-st <https://github.com/francesco-st>`_,
349 `@udnaan (Adnan) <https://github.com/udnaan>`_.
Victor Zverovich46291be2020-10-23 07:38:01 -0700350
351* Added the ``FMT_REDUCE_INT_INSTANTIATIONS`` CMake option that reduces the
352 binary code size at the cost of some integer formatting performance. This can
353 be useful for extremely memory-constrained embedded systems
354 (`#1778 <https://github.com/fmtlib/fmt/issues/1778>`_,
355 `#1781 <https://github.com/fmtlib/fmt/pull/1781>`_).
356 Thanks `@kammce (Khalil Estell) <https://github.com/kammce>`_.
357
Victor Zveroviche542e692020-10-25 06:46:45 -0700358* Added the ``FMT_USE_INLINE_NAMESPACES`` macro to control usage of inline
359 namespaces (`#1945 <https://github.com/fmtlib/fmt/pull/1945>`_).
360 Thanks `@darklukee <https://github.com/darklukee>`_.
361
Victor Zverovich740385d2020-10-24 11:18:33 -0700362* Improved build configuration
Victor Zverovich0452a4e2020-10-22 09:08:30 -0700363 (`#1760 <https://github.com/fmtlib/fmt/pull/1760>`_,
Victor Zverovich46291be2020-10-23 07:38:01 -0700364 `#1770 <https://github.com/fmtlib/fmt/pull/1770>`_,
Victor Zverovichcd465112020-10-24 09:24:47 -0700365 `#1779 <https://github.com/fmtlib/fmt/issues/1779>`_,
366 `#1783 <https://github.com/fmtlib/fmt/pull/1783>`_,
367 `#1823 <https://github.com/fmtlib/fmt/pull/1823>`_).
Victor Zverovich0452a4e2020-10-22 09:08:30 -0700368 Thanks `@dvetutnev (Dmitriy Vetutnev) <https://github.com/dvetutnev>`_,
Victor Zverovich46291be2020-10-23 07:38:01 -0700369 `@xvitaly (Vitaly Zaitsev) <https://github.com/xvitaly>`_,
Victor Zverovichcd465112020-10-24 09:24:47 -0700370 `@tambry (Raul Tambre) <https://github.com/tambry>`_,
371 `@medithe <https://github.com/medithe>`_,
372 `@martinwuehrer (Martin WĂŒhrer) <https://github.com/martinwuehrer>`_.
373
374* Fixed various warnings and compilation issues
375 (`#1790 <https://github.com/fmtlib/fmt/pull/1790>`_,
376 `#1802 <https://github.com/fmtlib/fmt/pull/1802>`_,
377 `#1808 <https://github.com/fmtlib/fmt/pull/1808>`_,
378 `#1810 <https://github.com/fmtlib/fmt/issues/1810>`_,
379 `#1811 <https://github.com/fmtlib/fmt/issues/1811>`_,
380 `#1812 <https://github.com/fmtlib/fmt/pull/1812>`_,
381 `#1814 <https://github.com/fmtlib/fmt/pull/1814>`_,
382 `#1816 <https://github.com/fmtlib/fmt/pull/1816>`_,
383 `#1817 <https://github.com/fmtlib/fmt/pull/1817>`_,
384 `#1818 <https://github.com/fmtlib/fmt/pull/1818>`_,
385 `#1825 <https://github.com/fmtlib/fmt/issues/1825>`_,
Victor Zverovich740385d2020-10-24 11:18:33 -0700386 `#1836 <https://github.com/fmtlib/fmt/pull/1836>`_,
387 `#1855 <https://github.com/fmtlib/fmt/pull/1855>`_,
388 `#1856 <https://github.com/fmtlib/fmt/pull/1856>`_,
389 `#1860 <https://github.com/fmtlib/fmt/pull/1860>`_,
390 `#1877 <https://github.com/fmtlib/fmt/pull/1877>`_,
391 `#1879 <https://github.com/fmtlib/fmt/pull/1879>`_,
Victor Zveroviche542e692020-10-25 06:46:45 -0700392 `#1880 <https://github.com/fmtlib/fmt/pull/1880>`_,
Victor Zverovichc10e3f72020-10-25 07:29:24 -0700393 `#1896 <https://github.com/fmtlib/fmt/issues/1896>`_,
Victor Zveroviche542e692020-10-25 06:46:45 -0700394 `#1897 <https://github.com/fmtlib/fmt/pull/1897>`_,
395 `#1898 <https://github.com/fmtlib/fmt/pull/1898>`_,
Victor Zverovichc10e3f72020-10-25 07:29:24 -0700396 `#1904 <https://github.com/fmtlib/fmt/issues/1904>`_,
Victor Zveroviche542e692020-10-25 06:46:45 -0700397 `#1908 <https://github.com/fmtlib/fmt/pull/1908>`_,
Victor Zverovichc10e3f72020-10-25 07:29:24 -0700398 `#1911 <https://github.com/fmtlib/fmt/issues/1911>`_,
Victor Zveroviche542e692020-10-25 06:46:45 -0700399 `#1912 <https://github.com/fmtlib/fmt/issues/1912>`_,
400 `#1928 <https://github.com/fmtlib/fmt/issues/1928>`_,
401 `#1929 <https://github.com/fmtlib/fmt/pull/1929>`_,
402 `#1935 <https://github.com/fmtlib/fmt/issues/1935>`_
403 `#1937 <https://github.com/fmtlib/fmt/pull/1937>`_,
Victor Zverovichc10e3f72020-10-25 07:29:24 -0700404 `#1942 <https://github.com/fmtlib/fmt/pull/1942>`_,
405 `#1949 <https://github.com/fmtlib/fmt/issues/1949>`_).
Victor Zverovichcd465112020-10-24 09:24:47 -0700406 Thanks `@TheQwertiest <https://github.com/TheQwertiest>`_,
407 `@medithe <https://github.com/medithe>`_,
408 `@martinwuehrer (Martin WĂŒhrer) <https://github.com/martinwuehrer>`_,
409 `@n16h7hunt3r <https://github.com/n16h7hunt3r>`_,
410 `@Othereum (Seokjin Lee) <https://github.com/Othereum>`_,
411 `@gsjaardema (Greg Sjaardema) <https://github.com/gsjaardema>`_,
Victor Zverovich740385d2020-10-24 11:18:33 -0700412 `@AlexanderLanin (Alexander Lanin) <https://github.com/AlexanderLanin>`_,
413 `@gcerretani (Giovanni Cerretani) <https://github.com/gcerretani>`_,
414 `@chronoxor (Ivan Shynkarenka) <https://github.com/chronoxor>`_,
415 `@noizefloor (Jan Schwers) <https://github.com/noizefloor>`_,
416 `@akohlmey (Axel Kohlmeyer) <https://github.com/akohlmey>`_,
417 `@jk-jeon (Junekey Jeon) <https://github.com/jk-jeon>`_,
Victor Zveroviche542e692020-10-25 06:46:45 -0700418 `@rimathia <https://github.com/rimathia>`_,
419 `@rglarix (Riccardo Ghetta (larix)) <https://github.com/rglarix>`_,
420 `@moiwi <https://github.com/moiwi>`_,
421 `@heckad (Kazantcev Andrey) <https://github.com/heckad>`_,
422 `@MarcDirven <https://github.com/MarcDirven>`_.
423 `@BartSiwek (Bart Siwek) <https://github.com/BartSiwek>`_,
424 `@darklukee <https://github.com/darklukee>`_.
Victor Zverovichda8278e2020-10-19 14:37:14 -0700425
Victor Zverovichcd4af112020-08-06 08:51:01 -07004267.0.3 - 2020-08-06
427------------------
Victor Zverovich72920ba2020-08-06 07:34:56 -0700428
429* Worked around broken ``numeric_limits`` for 128-bit integers
430 (`#1787 <https://github.com/fmtlib/fmt/issues/1787>`_).
431
432* Added error reporting on missing named arguments
433 (`#1796 <https://github.com/fmtlib/fmt/issues/1796>`_).
434
435* Stopped using 128-bit integers with clang-cl
436 (`#1800 <https://github.com/fmtlib/fmt/pull/1800>`_).
437 Thanks `@Kingcom <https://github.com/Kingcom>`_.
438
Victor Zverovichf4c99702020-08-06 07:40:46 -0700439* Fixed issues in locale-specific integer formatting
Victor Zverovich72920ba2020-08-06 07:34:56 -0700440 (`#1782 <https://github.com/fmtlib/fmt/issues/1782>`_,
Victor Zverovichf4c99702020-08-06 07:40:46 -0700441 `#1801 <https://github.com/fmtlib/fmt/issues/1801>`_).
Victor Zverovich72920ba2020-08-06 07:34:56 -0700442
Victor Zverovichb9d74902020-07-29 07:30:55 -07004437.0.2 - 2020-07-29
444------------------
Victor Zverovichcbf6be92020-07-28 09:15:02 -0700445
446* Worked around broken ``numeric_limits`` for 128-bit integers
447 (`#1725 <https://github.com/fmtlib/fmt/issues/1725>`_).
448
449* Fixed compatibility with CMake 3.4
450 (`#1779 <https://github.com/fmtlib/fmt/issues/1779>`_).
451
452* Fixed handling of digit separators in locale-specific formatting
453 (`#1782 <https://github.com/fmtlib/fmt/issues/1782>`_).
454
Victor Zverovichf19b1a52020-07-07 07:47:44 -07004557.0.1 - 2020-07-07
456------------------
Victor Zverovichd30bca62020-07-04 17:43:30 -0700457
Victor Zverovichf1dd2eb2020-07-07 06:24:32 -0700458* Updated the inline version namespace name.
459
460* Worked around a gcc bug in mangling of alias templates
461 (`#1753 <https://github.com/fmtlib/fmt/issues/1753>`_).
462
463* Fixed a linkage error on Windows
464 (`#1757 <https://github.com/fmtlib/fmt/issues/1757>`_).
465 Thanks `@Kurkin (Dmitry Kurkin) <https://github.com/Kurkin>`_.
466
467* Fixed minor issues with the documentation.
468
Victor Zverovich6be67622020-07-07 06:32:19 -07004697.0.0 - 2020-07-05
Victor Zverovichf1dd2eb2020-07-07 06:24:32 -0700470------------------
471
Victor Zverovich7dbc8ac2020-07-05 06:29:05 -0700472* Reduced the library size. For example, on macOS a stripped test binary
Victor Zverovichc87dd742020-07-05 06:20:50 -0700473 statically linked with {fmt} `shrank from ~368k to less than 100k
474 <http://www.zverovich.net/2020/05/21/reducing-library-size.html>`_.
475
Victor Zverovich1614af32020-07-05 08:43:01 -0700476* Added a simpler and more efficient `format string compilation API
Victor Zverovichcd465112020-10-24 09:24:47 -0700477 <https://fmt.dev/7.0.0/api.html#compile-api>`_:
Victor Zverovichc87dd742020-07-05 06:20:50 -0700478
479 .. code:: c++
480
481 #include <fmt/compile.h>
482
483 // Converts 42 into std::string using the most efficient method and no
484 // runtime format string processing.
485 std::string s = fmt::format(FMT_COMPILE("{}"), 42);
486
487 The old ``fmt::compile`` API is now deprecated.
Victor Zverovichd30bca62020-07-04 17:43:30 -0700488
489* Optimized integer formatting: ``format_to`` with format string compilation
Victor Zverovich7dbc8ac2020-07-05 06:29:05 -0700490 and a stack-allocated buffer is now `faster than to_chars on both
Victor Zverovichc87dd742020-07-05 06:20:50 -0700491 libc++ and libstdc++
492 <http://www.zverovich.net/2020/06/13/fast-int-to-string-revisited.html>`_.
Victor Zverovichd30bca62020-07-04 17:43:30 -0700493
Victor Zverovich7dbc8ac2020-07-05 06:29:05 -0700494* Optimized handling of small format strings. For example,
495
496 .. code:: c++
497
498 fmt::format("Result: {}: ({},{},{},{})", str1, str2, str3, str4, str5)
499
500 is now ~40% faster (`#1685 <https://github.com/fmtlib/fmt/issues/1685>`_).
501
Victor Zverovichd30bca62020-07-04 17:43:30 -0700502* Applied extern templates to improve compile times when using the core API
Victor Zverovich7dbc8ac2020-07-05 06:29:05 -0700503 and ``fmt/format.h`` (`#1452 <https://github.com/fmtlib/fmt/issues/1452>`_).
504 For example, on macOS with clang the compile time of a test translation unit
505 dropped from 2.3s to 0.3s with ``-O2`` and from 0.6s to 0.3s with the default
506 settings (``-O0``).
Victor Zverovichd30bca62020-07-04 17:43:30 -0700507
508 Before (``-O2``)::
509
510 % time c++ -c test.cc -I include -std=c++17 -O2
511 c++ -c test.cc -I include -std=c++17 -O2 2.22s user 0.08s system 99% cpu 2.311 total
512
513 After (``-O2``)::
514
515 % time c++ -c test.cc -I include -std=c++17 -O2
516 c++ -c test.cc -I include -std=c++17 -O2 0.26s user 0.04s system 98% cpu 0.303 total
517
518 Before (default)::
519
520 % time c++ -c test.cc -I include -std=c++17
521 c++ -c test.cc -I include -std=c++17 0.53s user 0.06s system 98% cpu 0.601 total
522
523 After (default)::
524
525 % time c++ -c test.cc -I include -std=c++17
526 c++ -c test.cc -I include -std=c++17 0.24s user 0.06s system 98% cpu 0.301 total
527
528 It is still recommended to use ``fmt/core.h`` instead of ``fmt/format.h`` but
Victor Zverovich1614af32020-07-05 08:43:01 -0700529 the compile time difference is now smaller. Thanks
530 `@alex3d <https://github.com/alex3d>`_ for the suggestion.
Victor Zverovichd30bca62020-07-04 17:43:30 -0700531
532* Named arguments are now stored on stack (no dynamic memory allocations) and
Victor Zverovich7dbc8ac2020-07-05 06:29:05 -0700533 the compiled code is more compact and efficient. For example
Victor Zverovichd30bca62020-07-04 17:43:30 -0700534
535 .. code:: c++
536
537 #include <fmt/core.h>
538
539 int main() {
540 fmt::print("The answer is {answer}\n", fmt::arg("answer", 42));
541 }
542
543 compiles to just (`godbolt <https://godbolt.org/z/NcfEp_>`__)
544
545 .. code:: asm
546
547 .LC0:
548 .string "answer"
549 .LC1:
550 .string "The answer is {answer}\n"
551 main:
552 sub rsp, 56
553 mov edi, OFFSET FLAT:.LC1
554 mov esi, 23
555 movabs rdx, 4611686018427387905
556 lea rax, [rsp+32]
557 lea rcx, [rsp+16]
558 mov QWORD PTR [rsp+8], 1
559 mov QWORD PTR [rsp], rax
560 mov DWORD PTR [rsp+16], 42
561 mov QWORD PTR [rsp+32], OFFSET FLAT:.LC0
562 mov DWORD PTR [rsp+40], 0
Victor Zverovichc87dd742020-07-05 06:20:50 -0700563 call fmt::v6::vprint(fmt::v6::basic_string_view<char>,
564 fmt::v6::format_args)
Victor Zverovichd30bca62020-07-04 17:43:30 -0700565 xor eax, eax
566 add rsp, 56
567 ret
568
569 .L.str.1:
570 .asciz "answer"
571
Victor Zverovich372175c2020-07-05 06:06:29 -0700572* Implemented compile-time checks for dynamic width and precision
573 (`#1614 <https://github.com/fmtlib/fmt/issues/1614>`_):
Victor Zverovichd30bca62020-07-04 17:43:30 -0700574
575 .. code:: c++
576
577 #include <fmt/format.h>
578
579 int main() {
580 fmt::print(FMT_STRING("{0:{1}}"), 42);
581 }
582
583 now gives a compilation error because argument 1 doesn't exist::
584
585 In file included from test.cc:1:
586 include/fmt/format.h:2726:27: error: constexpr variable 'invalid_format' must be
587 initialized by a constant expression
588 FMT_CONSTEXPR_DECL bool invalid_format =
589 ^
590 ...
591 include/fmt/core.h:569:26: note: in call to
592 '&checker(s, {}).context_->on_error(&"argument not found"[0])'
593 if (id >= num_args_) on_error("argument not found");
594 ^
595
Victor Zverovich372175c2020-07-05 06:06:29 -0700596* Added sentinel support to ``fmt::join``
Victor Zverovicha29a01d2020-07-06 09:50:24 -0700597 (`#1689 <https://github.com/fmtlib/fmt/pull/1689>`_)
Victor Zverovichd30bca62020-07-04 17:43:30 -0700598
599 .. code:: c++
600
601 struct zstring_sentinel {};
602 bool operator==(const char* p, zstring_sentinel) { return *p == '\0'; }
603 bool operator!=(const char* p, zstring_sentinel) { return *p != '\0'; }
604
605 struct zstring {
606 const char* p;
607 const char* begin() const { return p; }
608 zstring_sentinel end() const { return {}; }
609 };
610
611 auto s = fmt::format("{}", fmt::join(zstring{"hello"}, "_"));
612 // s == "h_e_l_l_o"
613
614 Thanks `@BRevzin (Barry Revzin) <https://github.com/BRevzin>`_.
615
Victor Zverovich0452a4e2020-10-22 09:08:30 -0700616* Added support for named arguments, ``clear`` and ``reserve`` to
Victor Zverovich372175c2020-07-05 06:06:29 -0700617 ``dynamic_format_arg_store``
618 (`#1655 <https://github.com/fmtlib/fmt/issues/1655>`_,
619 `#1663 <https://github.com/fmtlib/fmt/pull/1663>`_,
Victor Zverovichc87dd742020-07-05 06:20:50 -0700620 `#1674 <https://github.com/fmtlib/fmt/pull/1674>`_,
Victor Zverovich372175c2020-07-05 06:06:29 -0700621 `#1677 <https://github.com/fmtlib/fmt/pull/1677>`_).
622 Thanks `@vsolontsov-ll (Vladimir Solontsov)
623 <https://github.com/vsolontsov-ll>`_.
Victor Zverovichd30bca62020-07-04 17:43:30 -0700624
625* Added support for the ``'c'`` format specifier to integral types for
Victor Zverovich372175c2020-07-05 06:06:29 -0700626 compatibility with ``std::format``
627 (`#1652 <https://github.com/fmtlib/fmt/issues/1652>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -0700628
Victor Zverovich7dbc8ac2020-07-05 06:29:05 -0700629* Replaced the ``'n'`` format specifier with ``'L'`` for compatibility with
630 ``std::format`` (`#1624 <https://github.com/fmtlib/fmt/issues/1624>`_).
631 The ``'n'`` specifier can be enabled via the ``FMT_DEPRECATED_N_SPECIFIER``
632 macro.
Victor Zverovichd30bca62020-07-04 17:43:30 -0700633
634* The ``'='`` format specifier is now disabled by default for compatibility with
635 ``std::format``. It can be enabled via the ``FMT_DEPRECATED_NUMERIC_ALIGN``
636 macro.
637
Victor Zverovichd30bca62020-07-04 17:43:30 -0700638* Removed the following deprecated APIs:
639
Victor Zverovichc87dd742020-07-05 06:20:50 -0700640 * ``FMT_STRING_ALIAS`` and ``fmt`` macros - replaced by ``FMT_STRING``
Victor Zverovichd30bca62020-07-04 17:43:30 -0700641 * ``fmt::basic_string_view::char_type`` - replaced by
642 ``fmt::basic_string_view::value_type``
643 * ``convert_to_int``
644 * ``format_arg_store::types``
645 * ``*parse_context`` - replaced by ``*format_parse_context``
646 * ``FMT_DEPRECATED_INCLUDE_OS``
Victor Zverovichc87dd742020-07-05 06:20:50 -0700647 * ``FMT_DEPRECATED_PERCENT`` - incompatible with ``std::format``
648 * ``*writer`` - replaced by compiled format API
Victor Zverovichd30bca62020-07-04 17:43:30 -0700649
Victor Zverovich372175c2020-07-05 06:06:29 -0700650* Renamed the ``internal`` namespace to ``detail``
651 (`#1538 <https://github.com/fmtlib/fmt/issues/1538>`_). The former is still
652 provided as an alias if the ``FMT_USE_INTERNAL`` macro is defined.
Victor Zverovichd30bca62020-07-04 17:43:30 -0700653
Victor Zverovich7dbc8ac2020-07-05 06:29:05 -0700654* Improved compatibility between ``fmt::printf`` with the standard specs
655 (`#1595 <https://github.com/fmtlib/fmt/issues/1595>`_,
656 `#1682 <https://github.com/fmtlib/fmt/pull/1682>`_,
657 `#1683 <https://github.com/fmtlib/fmt/pull/1683>`_,
658 `#1687 <https://github.com/fmtlib/fmt/pull/1687>`_,
659 `#1699 <https://github.com/fmtlib/fmt/pull/1699>`_).
660 Thanks `@rimathia <https://github.com/rimathia>`_.
661
Victor Zverovich1614af32020-07-05 08:43:01 -0700662* Fixed handling of ``operator<<`` overloads that use ``copyfmt``
Victor Zverovich7dbc8ac2020-07-05 06:29:05 -0700663 (`#1666 <https://github.com/fmtlib/fmt/issues/1666>`_).
664
Victor Zverovichc87dd742020-07-05 06:20:50 -0700665* Added the ``FMT_OS`` CMake option to control inclusion of OS-specific APIs
666 in the fmt target. This can be useful for embedded platforms
667 (`#1654 <https://github.com/fmtlib/fmt/issues/1654>`_,
668 `#1656 <https://github.com/fmtlib/fmt/pull/1656>`_).
669 Thanks `@kwesolowski (Krzysztof Wesolowski)
670 <https://github.com/kwesolowski>`_.
671
Victor Zverovichd30bca62020-07-04 17:43:30 -0700672* Replaced ``FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION`` with the ``FMT_FUZZ``
Victor Zverovich372175c2020-07-05 06:06:29 -0700673 macro to prevent interferring with fuzzing of projects using {fmt}
674 (`#1650 <https://github.com/fmtlib/fmt/pull/1650>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -0700675 Thanks `@asraa (Asra Ali) <https://github.com/asraa>`_.
676
Victor Zverovichc87dd742020-07-05 06:20:50 -0700677* Fixed compatibility with emscripten
678 (`#1636 <https://github.com/fmtlib/fmt/issues/1636>`_,
679 `#1637 <https://github.com/fmtlib/fmt/pull/1637>`_).
680 Thanks `@ArthurSonzogni (Arthur Sonzogni)
681 <https://github.com/ArthurSonzogni>`_.
682
Victor Zverovich372175c2020-07-05 06:06:29 -0700683* Improved documentation
684 (`#704 <https://github.com/fmtlib/fmt/issues/704>`_,
685 `#1643 <https://github.com/fmtlib/fmt/pull/1643>`_,
686 `#1660 <https://github.com/fmtlib/fmt/pull/1660>`_,
687 `#1681 <https://github.com/fmtlib/fmt/pull/1681>`_,
Victor Zverovichc87dd742020-07-05 06:20:50 -0700688 `#1691 <https://github.com/fmtlib/fmt/pull/1691>`_,
689 `#1706 <https://github.com/fmtlib/fmt/pull/1706>`_,
690 `#1714 <https://github.com/fmtlib/fmt/pull/1714>`_,
691 `#1721 <https://github.com/fmtlib/fmt/pull/1721>`_,
692 `#1739 <https://github.com/fmtlib/fmt/pull/1739>`_,
693 `#1740 <https://github.com/fmtlib/fmt/pull/1740>`_,
Victor Zverovich7dbc8ac2020-07-05 06:29:05 -0700694 `#1741 <https://github.com/fmtlib/fmt/pull/1741>`_,
695 `#1751 <https://github.com/fmtlib/fmt/pull/1751>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -0700696 Thanks `@senior7515 (Alexander Gallego) <https://github.com/senior7515>`_,
697 `@lsr0 (Lindsay Roberts) <https://github.com/lsr0>`_,
698 `@puetzk (Kevin Puetz) <https://github.com/puetzk>`_,
Victor Zverovichc87dd742020-07-05 06:20:50 -0700699 `@fpelliccioni (Fernando Pelliccioni) <https://github.com/fpelliccioni>`_,
700 Alexey Kuzmenko, `@jelly (jelle van der Waa) <https://github.com/jelly>`_,
701 `@claremacrae (Clare Macrae) <https://github.com/claremacrae>`_,
702 `@jiapengwen (æ–‡äœłéč) <https://github.com/jiapengwen>`_,
Victor Zverovich7dbc8ac2020-07-05 06:29:05 -0700703 `@gsjaardema (Greg Sjaardema) <https://github.com/gsjaardema>`_,
704 `@alexey-milovidov <https://github.com/alexey-milovidov>`_.
Victor Zverovichd30bca62020-07-04 17:43:30 -0700705
706* Implemented various build configuration fixes and improvements
Victor Zverovichc87dd742020-07-05 06:20:50 -0700707 (`#1603 <https://github.com/fmtlib/fmt/pull/1603>`_,
708 `#1657 <https://github.com/fmtlib/fmt/pull/1657>`_,
709 `#1702 <https://github.com/fmtlib/fmt/pull/1702>`_,
710 `#1728 <https://github.com/fmtlib/fmt/pull/1728>`_).
711 Thanks `@scramsby (Scott Ramsby) <https://github.com/scramsby>`_,
712 `@jtojnar (Jan Tojnar) <https://github.com/jtojnar>`_,
713 `@orivej (Orivej Desh) <https://github.com/orivej>`_,
714 `@flagarde <https://github.com/flagarde>`_.
Victor Zverovichd30bca62020-07-04 17:43:30 -0700715
Victor Zverovich372175c2020-07-05 06:06:29 -0700716* Fixed various warnings and compilation issues
717 (`#1616 <https://github.com/fmtlib/fmt/pull/1616>`_,
Victor Zverovichc87dd742020-07-05 06:20:50 -0700718 `#1620 <https://github.com/fmtlib/fmt/issues/1620>`_,
Victor Zverovich372175c2020-07-05 06:06:29 -0700719 `#1622 <https://github.com/fmtlib/fmt/issues/1622>`_,
Victor Zverovichc87dd742020-07-05 06:20:50 -0700720 `#1625 <https://github.com/fmtlib/fmt/issues/1625>`_,
Victor Zverovich372175c2020-07-05 06:06:29 -0700721 `#1627 <https://github.com/fmtlib/fmt/pull/1627>`_,
722 `#1628 <https://github.com/fmtlib/fmt/issues/1628>`_,
723 `#1629 <https://github.com/fmtlib/fmt/pull/1629>`_,
724 `#1631 <https://github.com/fmtlib/fmt/issues/1631>`_,
725 `#1633 <https://github.com/fmtlib/fmt/pull/1633>`_,
726 `#1649 <https://github.com/fmtlib/fmt/pull/1649>`_,
727 `#1658 <https://github.com/fmtlib/fmt/issues/1658>`_,
728 `#1661 <https://github.com/fmtlib/fmt/pull/1661>`_,
729 `#1667 <https://github.com/fmtlib/fmt/pull/1667>`_,
Victor Zverovichc87dd742020-07-05 06:20:50 -0700730 `#1668 <https://github.com/fmtlib/fmt/issues/1668>`_,
Victor Zverovich372175c2020-07-05 06:06:29 -0700731 `#1669 <https://github.com/fmtlib/fmt/pull/1669>`_,
732 `#1692 <https://github.com/fmtlib/fmt/issues/1692>`_,
733 `#1696 <https://github.com/fmtlib/fmt/pull/1696>`_,
Victor Zverovichc87dd742020-07-05 06:20:50 -0700734 `#1697 <https://github.com/fmtlib/fmt/pull/1697>`_,
735 `#1707 <https://github.com/fmtlib/fmt/issues/1707>`_,
736 `#1712 <https://github.com/fmtlib/fmt/pull/1712>`_,
737 `#1716 <https://github.com/fmtlib/fmt/pull/1716>`_,
738 `#1722 <https://github.com/fmtlib/fmt/pull/1722>`_,
739 `#1724 <https://github.com/fmtlib/fmt/issues/1724>`_,
740 `#1729 <https://github.com/fmtlib/fmt/pull/1729>`_,
741 `#1738 <https://github.com/fmtlib/fmt/pull/1738>`_,
742 `#1742 <https://github.com/fmtlib/fmt/issues/1742>`_,
743 `#1743 <https://github.com/fmtlib/fmt/issues/1743>`_,
744 `#1744 <https://github.com/fmtlib/fmt/pull/1744>`_,
745 `#1747 <https://github.com/fmtlib/fmt/issues/1747>`_,
746 `#1750 <https://github.com/fmtlib/fmt/pull/1750>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -0700747 Thanks `@gsjaardema (Greg Sjaardema) <https://github.com/gsjaardema>`_,
748 `@gabime (Gabi Melman) <https://github.com/gabime>`_,
749 `@johnor (Johan) <https://github.com/johnor>`_,
Victor Zverovich5c67fef2020-07-07 06:58:44 -0700750 `@Kurkin (Dmitry Kurkin) <https://github.com/Kurkin>`_,
Victor Zverovichd30bca62020-07-04 17:43:30 -0700751 `@invexed (James Beach) <https://github.com/invexed>`_,
752 `@peterbell10 <https://github.com/peterbell10>`_,
753 `@daixtrose (Markus Werle) <https://github.com/daixtrose>`_,
754 `@petrutlucian94 (Lucian Petrut) <https://github.com/petrutlucian94>`_,
Victor Zverovichc87dd742020-07-05 06:20:50 -0700755 `@Neargye (Daniil Goncharov) <https://github.com/Neargye>`_,
756 `@ambitslix (Attila M. Szilagyi) <https://github.com/ambitslix>`_,
757 `@gabime (Gabi Melman) <https://github.com/gabime>`_,
758 `@erthink (Leonid Yuriev) <https://github.com/erthink>`_,
759 `@tohammer (Tobias Hammer) <https://github.com/tohammer>`_,
760 `@0x8000-0000 (Florin Iucha) <https://github.com/0x8000-0000>`_.
Victor Zverovichd30bca62020-07-04 17:43:30 -0700761
7626.2.1 - 2020-05-09
763------------------
764
Victor Zverovich372175c2020-07-05 06:06:29 -0700765* Fixed ostream support in ``sprintf``
766 (`#1631 <https://github.com/fmtlib/fmt/issues/1631>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -0700767
768* Fixed type detection when using implicit conversion to ``string_view`` and
Victor Zverovich372175c2020-07-05 06:06:29 -0700769 ostream ``operator<<`` inconsistently
770 (`#1662 <https://github.com/fmtlib/fmt/issues/1662>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -0700771
7726.2.0 - 2020-04-05
773------------------
774
775* Improved error reporting when trying to format an object of a non-formattable
776 type:
777
778 .. code:: c++
779
780 fmt::format("{}", S());
781
782 now gives::
783
784 include/fmt/core.h:1015:5: error: static_assert failed due to requirement
785 'formattable' "Cannot format argument. To make type T formattable provide a
786 formatter<T> specialization:
787 https://fmt.dev/latest/api.html#formatting-user-defined-types"
788 static_assert(
789 ^
790 ...
791 note: in instantiation of function template specialization
792 'fmt::v6::format<char [3], S, char>' requested here
793 fmt::format("{}", S());
794 ^
795
796 if ``S`` is not formattable.
797
798* Reduced the library size by ~10%.
799
Victor Zverovich372175c2020-07-05 06:06:29 -0700800* Always print decimal point if ``#`` is specified
801 (`#1476 <https://github.com/fmtlib/fmt/issues/1476>`_,
802 `#1498 <https://github.com/fmtlib/fmt/issues/1498>`_):
Victor Zverovichd30bca62020-07-04 17:43:30 -0700803
804 .. code:: c++
805
806 fmt::print("{:#.0f}", 42.0);
807
808 now prints ``42.``
809
810* Implemented the ``'L'`` specifier for locale-specific numeric formatting to
811 improve compatibility with ``std::format``. The ``'n'`` specifier is now
812 deprecated and will be removed in the next major release.
813
814* Moved OS-specific APIs such as ``windows_error`` from ``fmt/format.h`` to
815 ``fmt/os.h``. You can define ``FMT_DEPRECATED_INCLUDE_OS`` to automatically
816 include ``fmt/os.h`` from ``fmt/format.h`` for compatibility but this will be
817 disabled in the next major release.
818
819* Added precision overflow detection in floating-point formatting.
820
821* Implemented detection of invalid use of ``fmt::arg``.
822
823* Used ``type_identity`` to block unnecessary template argument deduction.
824 Thanks Tim Song.
825
Victor Zverovich372175c2020-07-05 06:06:29 -0700826* Improved UTF-8 handling
827 (`#1109 <https://github.com/fmtlib/fmt/issues/1109>`_):
Victor Zverovichd30bca62020-07-04 17:43:30 -0700828
829 .. code:: c++
830
831 fmt::print("┌{0:─^{2}}┐\n"
832 "│{1: ^{2}}│\n"
833 "└{0:─^{2}}┘\n", "", "ПроĐČДт, ĐŒĐžŃ€!", 20);
834
835 now prints::
836
837 ┌────────────────────┐
838 │ ПроĐČДт, ĐŒĐžŃ€! │
839 └────────────────────┘
840
841 on systems that support Unicode.
842
Victor Zverovich372175c2020-07-05 06:06:29 -0700843* Added experimental dynamic argument storage
844 (`#1170 <https://github.com/fmtlib/fmt/issues/1170>`_,
845 `#1584 <https://github.com/fmtlib/fmt/pull/1584>`_):
Victor Zverovichd30bca62020-07-04 17:43:30 -0700846
847 .. code:: c++
848
849 fmt::dynamic_format_arg_store<fmt::format_context> store;
850 store.push_back("answer");
851 store.push_back(42);
852 fmt::vprint("The {} is {}.\n", store);
853
854 prints::
855
856 The answer is 42.
857
858 Thanks `@vsolontsov-ll (Vladimir Solontsov)
859 <https://github.com/vsolontsov-ll>`_.
860
Victor Zverovich372175c2020-07-05 06:06:29 -0700861* Made ``fmt::join`` accept ``initializer_list``
862 (`#1591 <https://github.com/fmtlib/fmt/pull/1591>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -0700863 Thanks `@Rapotkinnik (Nikolay Rapotkin) <https://github.com/Rapotkinnik>`_.
864
Victor Zverovich372175c2020-07-05 06:06:29 -0700865* Fixed handling of empty tuples
866 (`#1588 <https://github.com/fmtlib/fmt/issues/1588>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -0700867
Victor Zverovich372175c2020-07-05 06:06:29 -0700868* Fixed handling of output iterators in ``format_to_n``
869 (`#1506 <https://github.com/fmtlib/fmt/issues/1506>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -0700870
Victor Zverovich372175c2020-07-05 06:06:29 -0700871* Fixed formatting of ``std::chrono::duration`` types to wide output
872 (`#1533 <https://github.com/fmtlib/fmt/pull/1533>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -0700873 Thanks `@zeffy (pilao) <https://github.com/zeffy>`_.
874
Victor Zverovich372175c2020-07-05 06:06:29 -0700875* Added const ``begin`` and ``end`` overload to buffers
876 (`#1553 <https://github.com/fmtlib/fmt/pull/1553>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -0700877 Thanks `@dominicpoeschko <https://github.com/dominicpoeschko>`_.
878
879* Added the ability to disable floating-point formatting via ``FMT_USE_FLOAT``,
880 ``FMT_USE_DOUBLE`` and ``FMT_USE_LONG_DOUBLE`` macros for extremely
Victor Zverovich372175c2020-07-05 06:06:29 -0700881 memory-constrained embedded system
882 (`#1590 <https://github.com/fmtlib/fmt/pull/1590>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -0700883 Thanks `@albaguirre (Alberto Aguirre) <https://github.com/albaguirre>`_.
884
Victor Zverovich372175c2020-07-05 06:06:29 -0700885* Made ``FMT_STRING`` work with ``constexpr`` ``string_view``
886 (`#1589 <https://github.com/fmtlib/fmt/pull/1589>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -0700887 Thanks `@scramsby (Scott Ramsby) <https://github.com/scramsby>`_.
888
Victor Zverovich372175c2020-07-05 06:06:29 -0700889* Implemented a minor optimization in the format string parser
890 (`#1560 <https://github.com/fmtlib/fmt/pull/1560>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -0700891 Thanks `@IkarusDeveloper <https://github.com/IkarusDeveloper>`_.
892
Victor Zverovich372175c2020-07-05 06:06:29 -0700893* Improved attribute detection
894 (`#1469 <https://github.com/fmtlib/fmt/pull/1469>`_,
895 `#1475 <https://github.com/fmtlib/fmt/pull/1475>`_,
896 `#1576 <https://github.com/fmtlib/fmt/pull/1576>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -0700897 Thanks `@federico-busato (Federico) <https://github.com/federico-busato>`_,
898 `@chronoxor (Ivan Shynkarenka) <https://github.com/chronoxor>`_,
899 `@refnum <https://github.com/refnum>`_.
900
Victor Zverovich372175c2020-07-05 06:06:29 -0700901* Improved documentation
902 (`#1481 <https://github.com/fmtlib/fmt/pull/1481>`_,
903 `#1523 <https://github.com/fmtlib/fmt/pull/1523>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -0700904 Thanks `@JackBoosY (Jack·Boos·Yu) <https://github.com/JackBoosY>`_,
905 `@imba-tjd (è°­äčéŒŽ) <https://github.com/imba-tjd>`_.
906
907* Fixed symbol visibility on Linux when compiling with ``-fvisibility=hidden``
Victor Zverovich372175c2020-07-05 06:06:29 -0700908 (`#1535 <https://github.com/fmtlib/fmt/pull/1535>`_).
909 Thanks `@milianw (Milian Wolff) <https://github.com/milianw>`_.
Victor Zverovichd30bca62020-07-04 17:43:30 -0700910
911* Implemented various build configuration fixes and improvements
Victor Zverovich372175c2020-07-05 06:06:29 -0700912 (`#1264 <https://github.com/fmtlib/fmt/issues/1264>`_,
913 `#1460 <https://github.com/fmtlib/fmt/issues/1460>`_,
914 `#1534 <https://github.com/fmtlib/fmt/pull/1534>`_,
915 `#1536 <https://github.com/fmtlib/fmt/issues/1536>`_,
916 `#1545 <https://github.com/fmtlib/fmt/issues/1545>`_,
917 `#1546 <https://github.com/fmtlib/fmt/pull/1546>`_,
918 `#1566 <https://github.com/fmtlib/fmt/issues/1566>`_,
919 `#1582 <https://github.com/fmtlib/fmt/pull/1582>`_,
920 `#1597 <https://github.com/fmtlib/fmt/issues/1597>`_,
921 `#1598 <https://github.com/fmtlib/fmt/pull/1598>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -0700922 Thanks `@ambitslix (Attila M. Szilagyi) <https://github.com/ambitslix>`_,
923 `@jwillikers (Jordan Williams) <https://github.com/jwillikers>`_,
924 `@stac47 (Laurent Stacul) <https://github.com/stac47>`_.
925
926* Fixed various warnings and compilation issues
Victor Zverovich372175c2020-07-05 06:06:29 -0700927 (`#1433 <https://github.com/fmtlib/fmt/pull/1433>`_,
928 `#1461 <https://github.com/fmtlib/fmt/issues/1461>`_,
929 `#1470 <https://github.com/fmtlib/fmt/pull/1470>`_,
930 `#1480 <https://github.com/fmtlib/fmt/pull/1480>`_,
931 `#1485 <https://github.com/fmtlib/fmt/pull/1485>`_,
932 `#1492 <https://github.com/fmtlib/fmt/pull/1492>`_,
933 `#1493 <https://github.com/fmtlib/fmt/issues/1493>`_,
934 `#1504 <https://github.com/fmtlib/fmt/issues/1504>`_,
935 `#1505 <https://github.com/fmtlib/fmt/pull/1505>`_,
936 `#1512 <https://github.com/fmtlib/fmt/pull/1512>`_,
937 `#1515 <https://github.com/fmtlib/fmt/issues/1515>`_,
938 `#1516 <https://github.com/fmtlib/fmt/pull/1516>`_,
939 `#1518 <https://github.com/fmtlib/fmt/pull/1518>`_,
940 `#1519 <https://github.com/fmtlib/fmt/pull/1519>`_,
941 `#1520 <https://github.com/fmtlib/fmt/pull/1520>`_,
942 `#1521 <https://github.com/fmtlib/fmt/pull/1521>`_,
943 `#1522 <https://github.com/fmtlib/fmt/pull/1522>`_,
944 `#1524 <https://github.com/fmtlib/fmt/issues/1524>`_,
945 `#1530 <https://github.com/fmtlib/fmt/pull/1530>`_,
946 `#1531 <https://github.com/fmtlib/fmt/issues/1531>`_,
947 `#1532 <https://github.com/fmtlib/fmt/pull/1532>`_,
948 `#1539 <https://github.com/fmtlib/fmt/issues/1539>`_,
949 `#1547 <https://github.com/fmtlib/fmt/issues/1547>`_,
950 `#1548 <https://github.com/fmtlib/fmt/issues/1548>`_,
951 `#1554 <https://github.com/fmtlib/fmt/pull/1554>`_,
952 `#1567 <https://github.com/fmtlib/fmt/issues/1567>`_,
953 `#1568 <https://github.com/fmtlib/fmt/pull/1568>`_,
954 `#1569 <https://github.com/fmtlib/fmt/pull/1569>`_,
955 `#1571 <https://github.com/fmtlib/fmt/pull/1571>`_,
956 `#1573 <https://github.com/fmtlib/fmt/pull/1573>`_,
957 `#1575 <https://github.com/fmtlib/fmt/pull/1575>`_,
958 `#1581 <https://github.com/fmtlib/fmt/pull/1581>`_,
959 `#1583 <https://github.com/fmtlib/fmt/issues/1583>`_,
960 `#1586 <https://github.com/fmtlib/fmt/issues/1586>`_,
961 `#1587 <https://github.com/fmtlib/fmt/issues/1587>`_,
962 `#1594 <https://github.com/fmtlib/fmt/issues/1594>`_,
963 `#1596 <https://github.com/fmtlib/fmt/pull/1596>`_,
964 `#1604 <https://github.com/fmtlib/fmt/issues/1604>`_,
965 `#1606 <https://github.com/fmtlib/fmt/pull/1606>`_,
966 `#1607 <https://github.com/fmtlib/fmt/issues/1607>`_,
967 `#1609 <https://github.com/fmtlib/fmt/issues/1609>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -0700968 Thanks `@marti4d (Chris Martin) <https://github.com/marti4d>`_,
969 `@iPherian <https://github.com/iPherian>`_,
970 `@parkertomatoes <https://github.com/parkertomatoes>`_,
971 `@gsjaardema (Greg Sjaardema) <https://github.com/gsjaardema>`_,
972 `@chronoxor (Ivan Shynkarenka) <https://github.com/chronoxor>`_,
973 `@DanielaE (Daniela Engert) <https://github.com/DanielaE>`_,
974 `@torsten48 <https://github.com/torsten48>`_,
975 `@tohammer (Tobias Hammer) <https://github.com/tohammer>`_,
976 `@lefticus (Jason Turner) <https://github.com/lefticus>`_,
977 `@ryusakki (Haise) <https://github.com/ryusakki>`_,
978 `@adnsv (Alex Denisov) <https://github.com/adnsv>`_,
979 `@fghzxm <https://github.com/fghzxm>`_,
980 `@refnum <https://github.com/refnum>`_,
981 `@pramodk (Pramod Kumbhar) <https://github.com/pramodk>`_,
982 `@Spirrwell <https://github.com/Spirrwell>`_,
983 `@scramsby (Scott Ramsby) <https://github.com/scramsby>`_.
984
9856.1.2 - 2019-12-11
986------------------
987
Victor Zverovich372175c2020-07-05 06:06:29 -0700988* Fixed ABI compatibility with ``libfmt.so.6.0.0``
989 (`#1471 <https://github.com/fmtlib/fmt/issues/1471>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -0700990
Victor Zverovich372175c2020-07-05 06:06:29 -0700991* Fixed handling types convertible to ``std::string_view``
992 (`#1451 <https://github.com/fmtlib/fmt/pull/1451>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -0700993 Thanks `@denizevrenci (Deniz Evrenci) <https://github.com/denizevrenci>`_.
994
995* Made CUDA test an opt-in enabled via the ``FMT_CUDA_TEST`` CMake option.
996
Victor Zverovich372175c2020-07-05 06:06:29 -0700997* Fixed sign conversion warnings
998 (`#1440 <https://github.com/fmtlib/fmt/pull/1440>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -0700999 Thanks `@0x8000-0000 (Florin Iucha) <https://github.com/0x8000-0000>`_.
1000
10016.1.1 - 2019-12-04
1002------------------
1003
Victor Zverovich372175c2020-07-05 06:06:29 -07001004* Fixed shared library build on Windows
1005 (`#1443 <https://github.com/fmtlib/fmt/pull/1443>`_,
1006 `#1445 <https://github.com/fmtlib/fmt/issues/1445>`_,
1007 `#1446 <https://github.com/fmtlib/fmt/pull/1446>`_,
1008 `#1450 <https://github.com/fmtlib/fmt/issues/1450>`_).
1009 Thanks `@egorpugin (Egor Pugin) <https://github.com/egorpugin>`_,
Victor Zverovichd30bca62020-07-04 17:43:30 -07001010 `@bbolli (Beat Bolli) <https://github.com/bbolli>`_.
1011
1012* Added a missing decimal point in exponent notation with trailing zeros.
1013
1014* Removed deprecated ``format_arg_store::TYPES``.
1015
10166.1.0 - 2019-12-01
1017------------------
1018
1019* {fmt} now formats IEEE 754 ``float`` and ``double`` using the shortest decimal
1020 representation with correct rounding by default:
1021
1022 .. code:: c++
1023
1024 #include <cmath>
1025 #include <fmt/core.h>
1026
1027 int main() {
1028 fmt::print("{}", M_PI);
1029 }
1030
1031 prints ``3.141592653589793``.
1032
1033* Made the fast binary to decimal floating-point formatter the default,
1034 simplified it and improved performance. {fmt} is now 15 times faster than
1035 libc++'s ``std::ostringstream``, 11 times faster than ``printf`` and 10%
1036 faster than double-conversion on `dtoa-benchmark
1037 <https://github.com/fmtlib/dtoa-benchmark>`_:
1038
1039 ================== ========= =======
1040 Function Time (ns) Speedup
1041 ================== ========= =======
1042 ostringstream 1,346.30 1.00x
1043 ostrstream 1,195.74 1.13x
1044 sprintf 995.08 1.35x
1045 doubleconv 99.10 13.59x
1046 fmt 88.34 15.24x
1047 ================== ========= =======
1048
1049 .. image:: https://user-images.githubusercontent.com/576385/
1050 69767160-cdaca400-112f-11ea-9fc5-347c9f83caad.png
1051
1052* {fmt} no longer converts ``float`` arguments to ``double``. In particular this
1053 improves the default (shortest) representation of floats and makes
1054 ``fmt::format`` consistent with ``std::format`` specs
Victor Zverovich372175c2020-07-05 06:06:29 -07001055 (`#1336 <https://github.com/fmtlib/fmt/issues/1336>`_,
1056 `#1353 <https://github.com/fmtlib/fmt/issues/1353>`_,
1057 `#1360 <https://github.com/fmtlib/fmt/pull/1360>`_,
1058 `#1361 <https://github.com/fmtlib/fmt/pull/1361>`_):
Victor Zverovichd30bca62020-07-04 17:43:30 -07001059
1060 .. code:: c++
1061
1062 fmt::print("{}", 0.1f);
1063
1064 prints ``0.1`` instead of ``0.10000000149011612``.
1065
1066 Thanks `@orivej (Orivej Desh) <https://github.com/orivej>`_.
1067
1068* Made floating-point formatting output consistent with ``printf``/iostreams
Victor Zverovich372175c2020-07-05 06:06:29 -07001069 (`#1376 <https://github.com/fmtlib/fmt/issues/1376>`_,
1070 `#1417 <https://github.com/fmtlib/fmt/issues/1417>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07001071
Victor Zverovich372175c2020-07-05 06:06:29 -07001072* Added support for 128-bit integers
1073 (`#1287 <https://github.com/fmtlib/fmt/pull/1287>`_):
Victor Zverovichd30bca62020-07-04 17:43:30 -07001074
1075 .. code:: c++
1076
1077 fmt::print("{}", std::numeric_limits<__int128_t>::max());
1078
1079 prints ``170141183460469231731687303715884105727``.
1080
1081 Thanks `@denizevrenci (Deniz Evrenci) <https://github.com/denizevrenci>`_.
1082
1083* The overload of ``print`` that takes ``text_style`` is now atomic, i.e. the
Victor Zverovich372175c2020-07-05 06:06:29 -07001084 output from different threads doesn't interleave
1085 (`#1351 <https://github.com/fmtlib/fmt/pull/1351>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07001086 Thanks `@tankiJong (Tanki Zhang) <https://github.com/tankiJong>`_.
1087
1088* Made compile time in the header-only mode ~20% faster by reducing the number
1089 of template instantiations. ``wchar_t`` overload of ``vprint`` was moved from
1090 ``fmt/core.h`` to ``fmt/format.h``.
1091
1092* Added an overload of ``fmt::join`` that works with tuples
Victor Zverovich372175c2020-07-05 06:06:29 -07001093 (`#1322 <https://github.com/fmtlib/fmt/issues/1322>`_,
1094 `#1330 <https://github.com/fmtlib/fmt/pull/1330>`_):
Victor Zverovichd30bca62020-07-04 17:43:30 -07001095
1096 .. code:: c++
1097
1098 #include <tuple>
1099 #include <fmt/ranges.h>
1100
1101 int main() {
1102 std::tuple<char, int, float> t{'a', 1, 2.0f};
1103 fmt::print("{}", t);
1104 }
1105
1106 prints ``('a', 1, 2.0)``.
1107
1108 Thanks `@jeremyong (Jeremy Ong) <https://github.com/jeremyong>`_.
1109
1110* Changed formatting of octal zero with prefix from "00" to "0":
1111
1112 .. code:: c++
1113
1114 fmt::print("{:#o}", 0);
1115
1116 prints ``0``.
1117
Victor Zverovich372175c2020-07-05 06:06:29 -07001118* The locale is now passed to ostream insertion (``<<``) operators
1119 (`#1406 <https://github.com/fmtlib/fmt/pull/1406>`_):
Victor Zverovichd30bca62020-07-04 17:43:30 -07001120
1121 .. code:: c++
1122
1123 #include <fmt/locale.h>
1124 #include <fmt/ostream.h>
1125
1126 struct S {
1127 double value;
1128 };
1129
1130 std::ostream& operator<<(std::ostream& os, S s) {
1131 return os << s.value;
1132 }
1133
1134 int main() {
1135 auto s = fmt::format(std::locale("fr_FR.UTF-8"), "{}", S{0.42});
1136 // s == "0,42"
1137 }
1138
1139 Thanks `@dlaugt (Daniel LaĂŒgt) <https://github.com/dlaugt>`_.
1140
Victor Zverovich372175c2020-07-05 06:06:29 -07001141* Locale-specific number formatting now uses grouping
1142 (`#1393 <https://github.com/fmtlib/fmt/issues/1393>`_
1143 `#1394 <https://github.com/fmtlib/fmt/pull/1394>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07001144 Thanks `@skrdaniel <https://github.com/skrdaniel>`_.
1145
1146* Fixed handling of types with deleted implicit rvalue conversion to
Victor Zverovich372175c2020-07-05 06:06:29 -07001147 ``const char**`` (`#1421 <https://github.com/fmtlib/fmt/issues/1421>`_):
Victor Zverovichd30bca62020-07-04 17:43:30 -07001148
1149 .. code:: c++
1150
1151 struct mystring {
1152 operator const char*() const&;
1153 operator const char*() &;
1154 operator const char*() const&& = delete;
1155 operator const char*() && = delete;
1156 };
1157 mystring str;
1158 fmt::print("{}", str); // now compiles
1159
1160* Enums are now mapped to correct underlying types instead of ``int``
Victor Zverovich372175c2020-07-05 06:06:29 -07001161 (`#1286 <https://github.com/fmtlib/fmt/pull/1286>`_).
1162 Thanks `@agmt (Egor Seredin) <https://github.com/agmt>`_.
Victor Zverovichd30bca62020-07-04 17:43:30 -07001163
Victor Zverovich372175c2020-07-05 06:06:29 -07001164* Enum classes are no longer implicitly converted to ``int``
1165 (`#1424 <https://github.com/fmtlib/fmt/issues/1424>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07001166
1167* Added ``basic_format_parse_context`` for consistency with C++20
1168 ``std::format`` and deprecated ``basic_parse_context``.
1169
Victor Zverovich372175c2020-07-05 06:06:29 -07001170* Fixed handling of UTF-8 in precision
1171 (`#1389 <https://github.com/fmtlib/fmt/issues/1389>`_,
1172 `#1390 <https://github.com/fmtlib/fmt/pull/1390>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07001173 Thanks `@tajtiattila (Attila Tajti) <https://github.com/tajtiattila>`_.
1174
1175* {fmt} can now be installed on Linux, macOS and Windows with
1176 `Conda <https://docs.conda.io/en/latest/>`__ using its
1177 `conda-forge <https://conda-forge.org>`__
Victor Zverovich372175c2020-07-05 06:06:29 -07001178 `package <https://github.com/conda-forge/fmt-feedstock>`__
1179 (`#1410 <https://github.com/fmtlib/fmt/pull/1410>`_)::
Victor Zverovichd30bca62020-07-04 17:43:30 -07001180
1181 conda install -c conda-forge fmt
1182
1183 Thanks `@tdegeus (Tom de Geus) <https://github.com/tdegeus>`_.
1184
Victor Zverovich372175c2020-07-05 06:06:29 -07001185* Added a CUDA test (`#1285 <https://github.com/fmtlib/fmt/pull/1285>`_,
1186 `#1317 <https://github.com/fmtlib/fmt/pull/1317>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07001187 Thanks `@luncliff (Park DongHa) <https://github.com/luncliff>`_ and
1188 `@risa2000 <https://github.com/risa2000>`_.
1189
Victor Zverovich372175c2020-07-05 06:06:29 -07001190* Improved documentation (`#1276 <https://github.com/fmtlib/fmt/pull/1276>`_,
1191 `#1291 <https://github.com/fmtlib/fmt/issues/1291>`_,
1192 `#1296 <https://github.com/fmtlib/fmt/issues/1296>`_,
1193 `#1315 <https://github.com/fmtlib/fmt/pull/1315>`_,
1194 `#1332 <https://github.com/fmtlib/fmt/pull/1332>`_,
1195 `#1337 <https://github.com/fmtlib/fmt/pull/1337>`_,
1196 `#1395 <https://github.com/fmtlib/fmt/issues/1395>`_
1197 `#1418 <https://github.com/fmtlib/fmt/pull/1418>`_).
1198 Thanks
Victor Zverovichd30bca62020-07-04 17:43:30 -07001199 `@waywardmonkeys (Bruce Mitchener) <https://github.com/waywardmonkeys>`_,
1200 `@pauldreik (Paul Dreik) <https://github.com/pauldreik>`_,
1201 `@jackoalan (Jack Andersen) <https://github.com/jackoalan>`_.
1202
Victor Zverovich372175c2020-07-05 06:06:29 -07001203* Various code improvements
1204 (`#1358 <https://github.com/fmtlib/fmt/pull/1358>`_,
1205 `#1407 <https://github.com/fmtlib/fmt/pull/1407>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07001206 Thanks `@orivej (Orivej Desh) <https://github.com/orivej>`_,
1207 `@dpacbach (David P. Sicilia) <https://github.com/dpacbach>`_,
1208
Victor Zverovich372175c2020-07-05 06:06:29 -07001209* Fixed compile-time format string checks for user-defined types
1210 (`#1292 <https://github.com/fmtlib/fmt/issues/1292>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07001211
1212* Worked around a false positive in ``unsigned-integer-overflow`` sanitizer
Victor Zverovich372175c2020-07-05 06:06:29 -07001213 (`#1377 <https://github.com/fmtlib/fmt/issues/1377>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07001214
1215* Fixed various warnings and compilation issues
Victor Zverovich372175c2020-07-05 06:06:29 -07001216 (`#1273 <https://github.com/fmtlib/fmt/issues/1273>`_,
1217 `#1278 <https://github.com/fmtlib/fmt/pull/1278>`_,
1218 `#1280 <https://github.com/fmtlib/fmt/pull/1280>`_,
1219 `#1281 <https://github.com/fmtlib/fmt/issues/1281>`_,
1220 `#1288 <https://github.com/fmtlib/fmt/issues/1288>`_,
1221 `#1290 <https://github.com/fmtlib/fmt/pull/1290>`_,
1222 `#1301 <https://github.com/fmtlib/fmt/pull/1301>`_,
1223 `#1305 <https://github.com/fmtlib/fmt/issues/1305>`_,
1224 `#1306 <https://github.com/fmtlib/fmt/issues/1306>`_,
1225 `#1309 <https://github.com/fmtlib/fmt/issues/1309>`_,
1226 `#1312 <https://github.com/fmtlib/fmt/pull/1312>`_,
1227 `#1313 <https://github.com/fmtlib/fmt/issues/1313>`_,
1228 `#1316 <https://github.com/fmtlib/fmt/issues/1316>`_,
1229 `#1319 <https://github.com/fmtlib/fmt/issues/1319>`_,
1230 `#1320 <https://github.com/fmtlib/fmt/pull/1320>`_,
1231 `#1326 <https://github.com/fmtlib/fmt/pull/1326>`_,
1232 `#1328 <https://github.com/fmtlib/fmt/pull/1328>`_,
1233 `#1344 <https://github.com/fmtlib/fmt/issues/1344>`_,
1234 `#1345 <https://github.com/fmtlib/fmt/pull/1345>`_,
1235 `#1347 <https://github.com/fmtlib/fmt/pull/1347>`_,
1236 `#1349 <https://github.com/fmtlib/fmt/pull/1349>`_,
1237 `#1354 <https://github.com/fmtlib/fmt/issues/1354>`_,
1238 `#1362 <https://github.com/fmtlib/fmt/issues/1362>`_,
1239 `#1366 <https://github.com/fmtlib/fmt/issues/1366>`_,
1240 `#1364 <https://github.com/fmtlib/fmt/pull/1364>`_,
1241 `#1370 <https://github.com/fmtlib/fmt/pull/1370>`_,
1242 `#1371 <https://github.com/fmtlib/fmt/pull/1371>`_,
1243 `#1385 <https://github.com/fmtlib/fmt/issues/1385>`_,
1244 `#1388 <https://github.com/fmtlib/fmt/issues/1388>`_,
1245 `#1397 <https://github.com/fmtlib/fmt/pull/1397>`_,
1246 `#1414 <https://github.com/fmtlib/fmt/pull/1414>`_,
1247 `#1416 <https://github.com/fmtlib/fmt/pull/1416>`_,
1248 `#1422 <https://github.com/fmtlib/fmt/issues/1422>`_
1249 `#1427 <https://github.com/fmtlib/fmt/pull/1427>`_,
1250 `#1431 <https://github.com/fmtlib/fmt/issues/1431>`_,
1251 `#1433 <https://github.com/fmtlib/fmt/pull/1433>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07001252 Thanks `@hhb <https://github.com/hhb>`_,
1253 `@gsjaardema (Greg Sjaardema) <https://github.com/gsjaardema>`_,
1254 `@gabime (Gabi Melman) <https://github.com/gabime>`_,
1255 `@neheb (Rosen Penev) <https://github.com/neheb>`_,
1256 `@vedranmiletic (Vedran Miletić) <https://github.com/vedranmiletic>`_,
1257 `@dkavolis (Daumantas Kavolis) <https://github.com/dkavolis>`_,
1258 `@mwinterb <https://github.com/mwinterb>`_,
1259 `@orivej (Orivej Desh) <https://github.com/orivej>`_,
1260 `@denizevrenci (Deniz Evrenci) <https://github.com/denizevrenci>`_
1261 `@leonklingele <https://github.com/leonklingele>`_,
1262 `@chronoxor (Ivan Shynkarenka) <https://github.com/chronoxor>`_,
1263 `@kent-tri <https://github.com/kent-tri>`_,
1264 `@0x8000-0000 (Florin Iucha) <https://github.com/0x8000-0000>`_,
1265 `@marti4d (Chris Martin) <https://github.com/marti4d>`_.
1266
12676.0.0 - 2019-08-26
1268------------------
1269
1270* Switched to the `MIT license
1271 <https://github.com/fmtlib/fmt/blob/5a4b24613ba16cc689977c3b5bd8274a3ba1dd1f/LICENSE.rst>`_
1272 with an optional exception that allows distributing binary code without
1273 attribution.
1274
1275* Floating-point formatting is now locale-independent by default:
1276
1277 .. code:: c++
1278
1279 #include <locale>
1280 #include <fmt/core.h>
1281
1282 int main() {
1283 std::locale::global(std::locale("ru_RU.UTF-8"));
1284 fmt::print("value = {}", 4.2);
1285 }
1286
1287 prints "value = 4.2" regardless of the locale.
1288
1289 For locale-specific formatting use the ``n`` specifier:
1290
1291 .. code:: c++
1292
1293 std::locale::global(std::locale("ru_RU.UTF-8"));
1294 fmt::print("value = {:n}", 4.2);
1295
1296 prints "value = 4,2".
1297
1298* Added an experimental Grisu floating-point formatting algorithm
1299 implementation (disabled by default). To enable it compile with the
1300 ``FMT_USE_GRISU`` macro defined to 1:
1301
1302 .. code:: c++
1303
1304 #define FMT_USE_GRISU 1
1305 #include <fmt/format.h>
1306
1307 auto s = fmt::format("{}", 4.2); // formats 4.2 using Grisu
1308
1309 With Grisu enabled, {fmt} is 13x faster than ``std::ostringstream`` (libc++)
1310 and 10x faster than ``sprintf`` on `dtoa-benchmark
1311 <https://github.com/fmtlib/dtoa-benchmark>`_ (`full results
1312 <https://fmt.dev/unknown_mac64_clang10.0.html>`_):
1313
1314 .. image:: https://user-images.githubusercontent.com/576385/
1315 54883977-9fe8c000-4e28-11e9-8bde-272d122e7c52.jpg
1316
1317* Separated formatting and parsing contexts for consistency with
1318 `C++20 std::format <http://eel.is/c++draft/format>`_, removing the
1319 undocumented ``basic_format_context::parse_context()`` function.
1320
Victor Zverovich372175c2020-07-05 06:06:29 -07001321* Added `oss-fuzz <https://github.com/google/oss-fuzz>`_ support
1322 (`#1199 <https://github.com/fmtlib/fmt/pull/1199>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07001323 Thanks `@pauldreik (Paul Dreik) <https://github.com/pauldreik>`_.
1324
1325* ``formatter`` specializations now always take precedence over ``operator<<``
Victor Zverovich372175c2020-07-05 06:06:29 -07001326 (`#952 <https://github.com/fmtlib/fmt/issues/952>`_):
Victor Zverovichd30bca62020-07-04 17:43:30 -07001327
1328 .. code:: c++
1329
1330 #include <iostream>
1331 #include <fmt/ostream.h>
1332
1333 struct S {};
1334
1335 std::ostream& operator<<(std::ostream& os, S) {
1336 return os << 1;
1337 }
1338
1339 template <>
1340 struct fmt::formatter<S> : fmt::formatter<int> {
1341 auto format(S, format_context& ctx) {
1342 return formatter<int>::format(2, ctx);
1343 }
1344 };
1345
1346 int main() {
1347 std::cout << S() << "\n"; // prints 1 using operator<<
1348 fmt::print("{}\n", S()); // prints 2 using formatter
1349 }
1350
1351* Introduced the experimental ``fmt::compile`` function that does format string
Victor Zverovich372175c2020-07-05 06:06:29 -07001352 compilation (`#618 <https://github.com/fmtlib/fmt/issues/618>`_,
1353 `#1169 <https://github.com/fmtlib/fmt/issues/1169>`_,
1354 `#1171 <https://github.com/fmtlib/fmt/pull/1171>`_):
Victor Zverovichd30bca62020-07-04 17:43:30 -07001355
1356 .. code:: c++
1357
1358 #include <fmt/compile.h>
1359
1360 auto f = fmt::compile<int>("{}");
Victor Zverovichc87dd742020-07-05 06:20:50 -07001361 std::string s = fmt::format(f, 42); // can be called multiple times to
1362 // format different values
Victor Zverovichd30bca62020-07-04 17:43:30 -07001363 // s == "42"
1364
1365 It moves the cost of parsing a format string outside of the format function
1366 which can be beneficial when identically formatting many objects of the same
1367 types. Thanks `@stryku (Mateusz Janek) <https://github.com/stryku>`_.
1368
1369* Added experimental ``%`` format specifier that formats floating-point values
Victor Zverovich372175c2020-07-05 06:06:29 -07001370 as percentages (`#1060 <https://github.com/fmtlib/fmt/pull/1060>`_,
1371 `#1069 <https://github.com/fmtlib/fmt/pull/1069>`_,
1372 `#1071 <https://github.com/fmtlib/fmt/pull/1071>`_):
Victor Zverovichd30bca62020-07-04 17:43:30 -07001373
1374 .. code:: c++
1375
1376 auto s = fmt::format("{:.1%}", 0.42); // s == "42.0%"
1377
1378 Thanks `@gawain-bolton (Gawain Bolton) <https://github.com/gawain-bolton>`_.
1379
Victor Zverovich372175c2020-07-05 06:06:29 -07001380* Implemented precision for floating-point durations
1381 (`#1004 <https://github.com/fmtlib/fmt/issues/1004>`_,
1382 `#1012 <https://github.com/fmtlib/fmt/pull/1012>`_):
Victor Zverovichd30bca62020-07-04 17:43:30 -07001383
1384 .. code:: c++
1385
1386 auto s = fmt::format("{:.1}", std::chrono::duration<double>(1.234));
1387 // s == 1.2s
1388
1389 Thanks `@DanielaE (Daniela Engert) <https://github.com/DanielaE>`_.
1390
1391* Implemented ``chrono`` format specifiers ``%Q`` and ``%q`` that give the value
Victor Zverovich372175c2020-07-05 06:06:29 -07001392 and the unit respectively (`#1019 <https://github.com/fmtlib/fmt/pull/1019>`_):
Victor Zverovichd30bca62020-07-04 17:43:30 -07001393
1394 .. code:: c++
1395
1396 auto value = fmt::format("{:%Q}", 42s); // value == "42"
1397 auto unit = fmt::format("{:%q}", 42s); // unit == "s"
1398
1399 Thanks `@DanielaE (Daniela Engert) <https://github.com/DanielaE>`_.
1400
1401* Fixed handling of dynamic width in chrono formatter:
1402
1403 .. code:: c++
1404
1405 auto s = fmt::format("{0:{1}%H:%M:%S}", std::chrono::seconds(12345), 12);
1406 // ^ width argument index ^ width
1407 // s == "03:25:45 "
1408
1409 Thanks Howard Hinnant.
1410
1411* Removed deprecated ``fmt/time.h``. Use ``fmt/chrono.h`` instead.
1412
1413* Added ``fmt::format`` and ``fmt::vformat`` overloads that take ``text_style``
Victor Zverovich372175c2020-07-05 06:06:29 -07001414 (`#993 <https://github.com/fmtlib/fmt/issues/993>`_,
1415 `#994 <https://github.com/fmtlib/fmt/pull/994>`_):
Victor Zverovichd30bca62020-07-04 17:43:30 -07001416
1417 .. code:: c++
1418
1419 #include <fmt/color.h>
1420
1421 std::string message = fmt::format(fmt::emphasis::bold | fg(fmt::color::red),
1422 "The answer is {}.", 42);
1423
1424 Thanks `@Naios (Denis Blank) <https://github.com/Naios>`_.
1425
1426* Removed the deprecated color API (``print_colored``). Use the new API, namely
1427 ``print`` overloads that take ``text_style`` instead.
1428
1429* Made ``std::unique_ptr`` and ``std::shared_ptr`` formattable as pointers via
Victor Zverovich372175c2020-07-05 06:06:29 -07001430 ``fmt::ptr`` (`#1121 <https://github.com/fmtlib/fmt/pull/1121>`_):
Victor Zverovichd30bca62020-07-04 17:43:30 -07001431
1432 .. code:: c++
1433
1434 std::unique_ptr<int> p = ...;
1435 fmt::print("{}", fmt::ptr(p)); // prints p as a pointer
1436
1437 Thanks `@sighingnow (Tao He) <https://github.com/sighingnow>`_.
1438
Victor Zverovich372175c2020-07-05 06:06:29 -07001439* Made ``print`` and ``vprint`` report I/O errors
1440 (`#1098 <https://github.com/fmtlib/fmt/issues/1098>`_,
1441 `#1099 <https://github.com/fmtlib/fmt/pull/1099>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07001442 Thanks `@BillyDonahue (Billy Donahue) <https://github.com/BillyDonahue>`_.
1443
1444* Marked deprecated APIs with the ``[[deprecated]]`` attribute and removed
Victor Zverovich372175c2020-07-05 06:06:29 -07001445 internal uses of deprecated APIs
1446 (`#1022 <https://github.com/fmtlib/fmt/pull/1022>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07001447 Thanks `@eliaskosunen (Elias Kosunen) <https://github.com/eliaskosunen>`_.
1448
1449* Modernized the codebase using more C++11 features and removing workarounds.
1450 Most importantly, ``buffer_context`` is now an alias template, so
1451 use ``buffer_context<T>`` instead of ``buffer_context<T>::type``.
1452 These features require GCC 4.8 or later.
1453
1454* ``formatter`` specializations now always take precedence over implicit
1455 conversions to ``int`` and the undocumented ``convert_to_int`` trait
1456 is now deprecated.
1457
1458* Moved the undocumented ``basic_writer``, ``writer``, and ``wwriter`` types
1459 to the ``internal`` namespace.
1460
1461* Removed deprecated ``basic_format_context::begin()``. Use ``out()`` instead.
1462
1463* Disallowed passing the result of ``join`` as an lvalue to prevent misuse.
1464
1465* Refactored the undocumented structs that represent parsed format specifiers
1466 to simplify the API and allow multibyte fill.
1467
1468* Moved SFINAE to template parameters to reduce symbol sizes.
1469
1470* Switched to ``fputws`` for writing wide strings so that it's no longer
Victor Zverovich372175c2020-07-05 06:06:29 -07001471 required to call ``_setmode`` on Windows
1472 (`#1229 <https://github.com/fmtlib/fmt/issues/1229>`_,
1473 `#1243 <https://github.com/fmtlib/fmt/pull/1243>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07001474 Thanks `@jackoalan (Jack Andersen) <https://github.com/jackoalan>`_.
1475
Victor Zverovich372175c2020-07-05 06:06:29 -07001476* Improved literal-based API
1477 (`#1254 <https://github.com/fmtlib/fmt/pull/1254>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07001478 Thanks `@sylveon (Charles Milette) <https://github.com/sylveon>`_.
1479
1480* Added support for exotic platforms without ``uintptr_t`` such as IBM i
Victor Zverovich372175c2020-07-05 06:06:29 -07001481 (AS/400) which has 128-bit pointers and only 64-bit integers
1482 (`#1059 <https://github.com/fmtlib/fmt/issues/1059>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07001483
1484* Added `Sublime Text syntax highlighting config
1485 <https://github.com/fmtlib/fmt/blob/master/support/C%2B%2B.sublime-syntax>`_
Victor Zverovich372175c2020-07-05 06:06:29 -07001486 (`#1037 <https://github.com/fmtlib/fmt/issues/1037>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07001487 Thanks `@Kronuz (GermĂĄn MĂ©ndez Bravo) <https://github.com/Kronuz>`_.
1488
1489* Added the ``FMT_ENFORCE_COMPILE_STRING`` macro to enforce the use of
Victor Zverovich372175c2020-07-05 06:06:29 -07001490 compile-time format strings
1491 (`#1231 <https://github.com/fmtlib/fmt/pull/1231>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07001492 Thanks `@jackoalan (Jack Andersen) <https://github.com/jackoalan>`_.
1493
Victor Zverovich372175c2020-07-05 06:06:29 -07001494* Stopped setting ``CMAKE_BUILD_TYPE`` if {fmt} is a subproject
1495 (`#1081 <https://github.com/fmtlib/fmt/issues/1081>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07001496
Victor Zverovich372175c2020-07-05 06:06:29 -07001497* Various build improvements
1498 (`#1039 <https://github.com/fmtlib/fmt/pull/1039>`_,
1499 `#1078 <https://github.com/fmtlib/fmt/pull/1078>`_,
1500 `#1091 <https://github.com/fmtlib/fmt/pull/1091>`_,
1501 `#1103 <https://github.com/fmtlib/fmt/pull/1103>`_,
1502 `#1177 <https://github.com/fmtlib/fmt/pull/1177>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07001503 Thanks `@luncliff (Park DongHa) <https://github.com/luncliff>`_,
1504 `@jasonszang (Jason Shuo Zang) <https://github.com/jasonszang>`_,
1505 `@olafhering (Olaf Hering) <https://github.com/olafhering>`_,
1506 `@Lecetem <https://github.com/Lectem>`_,
1507 `@pauldreik (Paul Dreik) <https://github.com/pauldreik>`_.
1508
Victor Zverovich372175c2020-07-05 06:06:29 -07001509* Improved documentation
1510 (`#1049 <https://github.com/fmtlib/fmt/issues/1049>`_,
1511 `#1051 <https://github.com/fmtlib/fmt/pull/1051>`_,
1512 `#1083 <https://github.com/fmtlib/fmt/pull/1083>`_,
1513 `#1113 <https://github.com/fmtlib/fmt/pull/1113>`_,
1514 `#1114 <https://github.com/fmtlib/fmt/pull/1114>`_,
1515 `#1146 <https://github.com/fmtlib/fmt/issues/1146>`_,
1516 `#1180 <https://github.com/fmtlib/fmt/issues/1180>`_,
1517 `#1250 <https://github.com/fmtlib/fmt/pull/1250>`_,
1518 `#1252 <https://github.com/fmtlib/fmt/pull/1252>`_,
1519 `#1265 <https://github.com/fmtlib/fmt/pull/1265>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07001520 Thanks `@mikelui (Michael Lui) <https://github.com/mikelui>`_,
1521 `@foonathan (Jonathan MĂŒller) <https://github.com/foonathan>`_,
1522 `@BillyDonahue (Billy Donahue) <https://github.com/BillyDonahue>`_,
1523 `@jwakely (Jonathan Wakely) <https://github.com/jwakely>`_,
1524 `@kaisbe (Kais Ben Salah) <https://github.com/kaisbe>`_,
1525 `@sdebionne (Samuel Debionne) <https://github.com/sdebionne>`_.
1526
Victor Zverovich372175c2020-07-05 06:06:29 -07001527* Fixed ambiguous formatter specialization in ``fmt/ranges.h``
1528 (`#1123 <https://github.com/fmtlib/fmt/issues/1123>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07001529
1530* Fixed formatting of a non-empty ``std::filesystem::path`` which is an
Victor Zverovich372175c2020-07-05 06:06:29 -07001531 infinitely deep range of its components
1532 (`#1268 <https://github.com/fmtlib/fmt/issues/1268>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07001533
1534* Fixed handling of general output iterators when formatting characters
Victor Zverovich372175c2020-07-05 06:06:29 -07001535 (`#1056 <https://github.com/fmtlib/fmt/issues/1056>`_,
1536 `#1058 <https://github.com/fmtlib/fmt/pull/1058>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07001537 Thanks `@abolz (Alexander Bolz) <https://github.com/abolz>`_.
1538
1539* Fixed handling of output iterators in ``formatter`` specialization for
Victor Zverovich372175c2020-07-05 06:06:29 -07001540 ranges (`#1064 <https://github.com/fmtlib/fmt/issues/1064>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07001541
Victor Zverovich372175c2020-07-05 06:06:29 -07001542* Fixed handling of exotic character types
1543 (`#1188 <https://github.com/fmtlib/fmt/issues/1188>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07001544
Victor Zverovich372175c2020-07-05 06:06:29 -07001545* Made chrono formatting work with exceptions disabled
1546 (`#1062 <https://github.com/fmtlib/fmt/issues/1062>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07001547
Victor Zverovich372175c2020-07-05 06:06:29 -07001548* Fixed DLL visibility issues
1549 (`#1134 <https://github.com/fmtlib/fmt/pull/1134>`_,
1550 `#1147 <https://github.com/fmtlib/fmt/pull/1147>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07001551 Thanks `@denchat <https://github.com/denchat>`_.
1552
Victor Zverovich372175c2020-07-05 06:06:29 -07001553* Disabled the use of UDL template extension on GCC 9
1554 (`#1148 <https://github.com/fmtlib/fmt/issues/1148>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07001555
Victor Zverovich372175c2020-07-05 06:06:29 -07001556* Removed misplaced ``format`` compile-time checks from ``printf``
1557 (`#1173 <https://github.com/fmtlib/fmt/issues/1173>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07001558
1559* Fixed issues in the experimental floating-point formatter
Victor Zverovich372175c2020-07-05 06:06:29 -07001560 (`#1072 <https://github.com/fmtlib/fmt/issues/1072>`_,
1561 `#1129 <https://github.com/fmtlib/fmt/issues/1129>`_,
1562 `#1153 <https://github.com/fmtlib/fmt/issues/1153>`_,
1563 `#1155 <https://github.com/fmtlib/fmt/pull/1155>`_,
1564 `#1210 <https://github.com/fmtlib/fmt/issues/1210>`_,
1565 `#1222 <https://github.com/fmtlib/fmt/issues/1222>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07001566 Thanks `@alabuzhev (Alex Alabuzhev) <https://github.com/alabuzhev>`_.
1567
1568* Fixed bugs discovered by fuzzing or during fuzzing integration
Victor Zverovich372175c2020-07-05 06:06:29 -07001569 (`#1124 <https://github.com/fmtlib/fmt/issues/1124>`_,
1570 `#1127 <https://github.com/fmtlib/fmt/issues/1127>`_,
1571 `#1132 <https://github.com/fmtlib/fmt/issues/1132>`_,
1572 `#1135 <https://github.com/fmtlib/fmt/pull/1135>`_,
1573 `#1136 <https://github.com/fmtlib/fmt/issues/1136>`_,
1574 `#1141 <https://github.com/fmtlib/fmt/issues/1141>`_,
1575 `#1142 <https://github.com/fmtlib/fmt/issues/1142>`_,
1576 `#1178 <https://github.com/fmtlib/fmt/issues/1178>`_,
1577 `#1179 <https://github.com/fmtlib/fmt/issues/1179>`_,
1578 `#1194 <https://github.com/fmtlib/fmt/issues/1194>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07001579 Thanks `@pauldreik (Paul Dreik) <https://github.com/pauldreik>`_.
1580
Victor Zverovich372175c2020-07-05 06:06:29 -07001581* Fixed building tests on FreeBSD and Hurd
1582 (`#1043 <https://github.com/fmtlib/fmt/issues/1043>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07001583 Thanks `@jackyf (Eugene V. Lyubimkin) <https://github.com/jackyf>`_.
1584
Victor Zverovich372175c2020-07-05 06:06:29 -07001585* Fixed various warnings and compilation issues
1586 (`#998 <https://github.com/fmtlib/fmt/pull/998>`_,
1587 `#1006 <https://github.com/fmtlib/fmt/pull/1006>`_,
1588 `#1008 <https://github.com/fmtlib/fmt/issues/1008>`_,
1589 `#1011 <https://github.com/fmtlib/fmt/issues/1011>`_,
1590 `#1025 <https://github.com/fmtlib/fmt/issues/1025>`_,
1591 `#1027 <https://github.com/fmtlib/fmt/pull/1027>`_,
1592 `#1028 <https://github.com/fmtlib/fmt/pull/1028>`_,
1593 `#1029 <https://github.com/fmtlib/fmt/pull/1029>`_,
1594 `#1030 <https://github.com/fmtlib/fmt/pull/1030>`_,
1595 `#1031 <https://github.com/fmtlib/fmt/pull/1031>`_,
1596 `#1054 <https://github.com/fmtlib/fmt/pull/1054>`_,
1597 `#1063 <https://github.com/fmtlib/fmt/issues/1063>`_,
1598 `#1068 <https://github.com/fmtlib/fmt/pull/1068>`_,
1599 `#1074 <https://github.com/fmtlib/fmt/pull/1074>`_,
1600 `#1075 <https://github.com/fmtlib/fmt/pull/1075>`_,
1601 `#1079 <https://github.com/fmtlib/fmt/pull/1079>`_,
1602 `#1086 <https://github.com/fmtlib/fmt/pull/1086>`_,
1603 `#1088 <https://github.com/fmtlib/fmt/issues/1088>`_,
1604 `#1089 <https://github.com/fmtlib/fmt/pull/1089>`_,
1605 `#1094 <https://github.com/fmtlib/fmt/pull/1094>`_,
1606 `#1101 <https://github.com/fmtlib/fmt/issues/1101>`_,
1607 `#1102 <https://github.com/fmtlib/fmt/pull/1102>`_,
1608 `#1105 <https://github.com/fmtlib/fmt/issues/1105>`_,
1609 `#1107 <https://github.com/fmtlib/fmt/pull/1107>`_,
1610 `#1115 <https://github.com/fmtlib/fmt/issues/1115>`_,
1611 `#1117 <https://github.com/fmtlib/fmt/issues/1117>`_,
1612 `#1118 <https://github.com/fmtlib/fmt/issues/1118>`_,
1613 `#1120 <https://github.com/fmtlib/fmt/issues/1120>`_,
1614 `#1123 <https://github.com/fmtlib/fmt/issues/1123>`_,
1615 `#1139 <https://github.com/fmtlib/fmt/pull/1139>`_,
1616 `#1140 <https://github.com/fmtlib/fmt/issues/1140>`_,
1617 `#1143 <https://github.com/fmtlib/fmt/issues/1143>`_,
1618 `#1144 <https://github.com/fmtlib/fmt/pull/1144>`_,
1619 `#1150 <https://github.com/fmtlib/fmt/pull/1150>`_,
1620 `#1151 <https://github.com/fmtlib/fmt/pull/1151>`_,
1621 `#1152 <https://github.com/fmtlib/fmt/issues/1152>`_,
1622 `#1154 <https://github.com/fmtlib/fmt/issues/1154>`_,
1623 `#1156 <https://github.com/fmtlib/fmt/issues/1156>`_,
1624 `#1159 <https://github.com/fmtlib/fmt/pull/1159>`_,
1625 `#1175 <https://github.com/fmtlib/fmt/issues/1175>`_,
1626 `#1181 <https://github.com/fmtlib/fmt/issues/1181>`_,
1627 `#1186 <https://github.com/fmtlib/fmt/issues/1186>`_,
1628 `#1187 <https://github.com/fmtlib/fmt/pull/1187>`_,
1629 `#1191 <https://github.com/fmtlib/fmt/pull/1191>`_,
1630 `#1197 <https://github.com/fmtlib/fmt/issues/1197>`_,
1631 `#1200 <https://github.com/fmtlib/fmt/issues/1200>`_,
1632 `#1203 <https://github.com/fmtlib/fmt/issues/1203>`_,
1633 `#1205 <https://github.com/fmtlib/fmt/issues/1205>`_,
1634 `#1206 <https://github.com/fmtlib/fmt/pull/1206>`_,
1635 `#1213 <https://github.com/fmtlib/fmt/issues/1213>`_,
1636 `#1214 <https://github.com/fmtlib/fmt/issues/1214>`_,
1637 `#1217 <https://github.com/fmtlib/fmt/pull/1217>`_,
1638 `#1228 <https://github.com/fmtlib/fmt/issues/1228>`_,
1639 `#1230 <https://github.com/fmtlib/fmt/pull/1230>`_,
1640 `#1232 <https://github.com/fmtlib/fmt/issues/1232>`_,
1641 `#1235 <https://github.com/fmtlib/fmt/pull/1235>`_,
1642 `#1236 <https://github.com/fmtlib/fmt/pull/1236>`_,
1643 `#1240 <https://github.com/fmtlib/fmt/issues/1240>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07001644 Thanks `@DanielaE (Daniela Engert) <https://github.com/DanielaE>`_,
1645 `@mwinterb <https://github.com/mwinterb>`_,
1646 `@eliaskosunen (Elias Kosunen) <https://github.com/eliaskosunen>`_,
1647 `@morinmorin <https://github.com/morinmorin>`_,
1648 `@ricco19 (Brian Ricciardelli) <https://github.com/ricco19>`_,
1649 `@waywardmonkeys (Bruce Mitchener) <https://github.com/waywardmonkeys>`_,
1650 `@chronoxor (Ivan Shynkarenka) <https://github.com/chronoxor>`_,
1651 `@remyabel <https://github.com/remyabel>`_,
1652 `@pauldreik (Paul Dreik) <https://github.com/pauldreik>`_,
1653 `@gsjaardema (Greg Sjaardema) <https://github.com/gsjaardema>`_,
1654 `@rcane (Ronny KrĂŒger) <https://github.com/rcane>`_,
1655 `@mocabe <https://github.com/mocabe>`_,
1656 `@denchat <https://github.com/denchat>`_,
1657 `@cjdb (Christopher Di Bella) <https://github.com/cjdb>`_,
1658 `@HazardyKnusperkeks (Björn SchÀpers) <https://github.com/HazardyKnusperkeks>`_,
1659 `@vedranmiletic (Vedran Miletić) <https://github.com/vedranmiletic>`_,
1660 `@jackoalan (Jack Andersen) <https://github.com/jackoalan>`_,
1661 `@DaanDeMeyer (Daan De Meyer) <https://github.com/DaanDeMeyer>`_,
1662 `@starkmapper (Mark Stapper) <https://github.com/starkmapper>`_.
1663
16645.3.0 - 2018-12-28
1665------------------
1666
1667* Introduced experimental chrono formatting support:
1668
1669 .. code:: c++
1670
1671 #include <fmt/chrono.h>
1672
1673 int main() {
1674 using namespace std::literals::chrono_literals;
1675 fmt::print("Default format: {} {}\n", 42s, 100ms);
1676 fmt::print("strftime-like format: {:%H:%M:%S}\n", 3h + 15min + 30s);
1677 }
1678
1679 prints::
1680
1681 Default format: 42s 100ms
1682 strftime-like format: 03:15:30
1683
1684* Added experimental support for emphasis (bold, italic, underline,
1685 strikethrough), colored output to a file stream, and improved colored
Victor Zverovich372175c2020-07-05 06:06:29 -07001686 formatting API
1687 (`#961 <https://github.com/fmtlib/fmt/pull/961>`_,
1688 `#967 <https://github.com/fmtlib/fmt/pull/967>`_,
1689 `#973 <https://github.com/fmtlib/fmt/pull/973>`_):
Victor Zverovichd30bca62020-07-04 17:43:30 -07001690
1691 .. code:: c++
1692
1693 #include <fmt/color.h>
1694
1695 int main() {
1696 print(fg(fmt::color::crimson) | fmt::emphasis::bold,
1697 "Hello, {}!\n", "world");
1698 print(fg(fmt::color::floral_white) | bg(fmt::color::slate_gray) |
1699 fmt::emphasis::underline, "Hello, {}!\n", "ĐŒĐžŃ€");
1700 print(fg(fmt::color::steel_blue) | fmt::emphasis::italic,
1701 "Hello, {}!\n", "侖界");
1702 }
1703
1704 prints the following on modern terminals with RGB color support:
1705
1706 .. image:: https://user-images.githubusercontent.com/576385/
1707 50405788-b66e7500-076e-11e9-9592-7324d1f951d8.png
1708
1709 Thanks `@Rakete1111 (Nicolas) <https://github.com/Rakete1111>`_.
1710
Victor Zverovich372175c2020-07-05 06:06:29 -07001711* Added support for 4-bit terminal colors
1712 (`#968 <https://github.com/fmtlib/fmt/issues/968>`_,
1713 `#974 <https://github.com/fmtlib/fmt/pull/974>`_)
Victor Zverovichd30bca62020-07-04 17:43:30 -07001714
1715 .. code:: c++
1716
1717 #include <fmt/color.h>
1718
1719 int main() {
1720 print(fg(fmt::terminal_color::red), "stop\n");
1721 }
1722
1723 Note that these colors vary by terminal:
1724
1725 .. image:: https://user-images.githubusercontent.com/576385/
1726 50405925-dbfc7e00-0770-11e9-9b85-333fab0af9ac.png
1727
1728 Thanks `@Rakete1111 (Nicolas) <https://github.com/Rakete1111>`_.
1729
1730* Parameterized formatting functions on the type of the format string
Victor Zverovich372175c2020-07-05 06:06:29 -07001731 (`#880 <https://github.com/fmtlib/fmt/issues/880>`_,
1732 `#881 <https://github.com/fmtlib/fmt/pull/881>`_,
1733 `#883 <https://github.com/fmtlib/fmt/pull/883>`_,
1734 `#885 <https://github.com/fmtlib/fmt/pull/885>`_,
1735 `#897 <https://github.com/fmtlib/fmt/pull/897>`_,
1736 `#920 <https://github.com/fmtlib/fmt/issues/920>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07001737 Any object of type ``S`` that has an overloaded ``to_string_view(const S&)``
1738 returning ``fmt::string_view`` can be used as a format string:
1739
1740 .. code:: c++
1741
1742 namespace my_ns {
1743 inline string_view to_string_view(const my_string& s) {
1744 return {s.data(), s.length()};
1745 }
1746 }
1747
1748 std::string message = fmt::format(my_string("The answer is {}."), 42);
1749
1750 Thanks `@DanielaE (Daniela Engert) <https://github.com/DanielaE>`_.
1751
Victor Zverovich372175c2020-07-05 06:06:29 -07001752* Made ``std::string_view`` work as a format string
1753 (`#898 <https://github.com/fmtlib/fmt/pull/898>`_):
Victor Zverovichd30bca62020-07-04 17:43:30 -07001754
1755 .. code:: c++
1756
1757 auto message = fmt::format(std::string_view("The answer is {}."), 42);
1758
1759 Thanks `@DanielaE (Daniela Engert) <https://github.com/DanielaE>`_.
1760
Victor Zverovich372175c2020-07-05 06:06:29 -07001761* Added wide string support to compile-time format string checks
1762 (`#924 <https://github.com/fmtlib/fmt/pull/924>`_):
Victor Zverovichd30bca62020-07-04 17:43:30 -07001763
1764 .. code:: c++
1765
1766 print(fmt(L"{:f}"), 42); // compile-time error: invalid type specifier
1767
1768 Thanks `@XZiar <https://github.com/XZiar>`_.
1769
Victor Zverovich372175c2020-07-05 06:06:29 -07001770* Made colored print functions work with wide strings
1771 (`#867 <https://github.com/fmtlib/fmt/pull/867>`_):
Victor Zverovichd30bca62020-07-04 17:43:30 -07001772
1773 .. code:: c++
1774
1775 #include <fmt/color.h>
1776
1777 int main() {
1778 print(fg(fmt::color::red), L"{}\n", 42);
1779 }
1780
1781 Thanks `@DanielaE (Daniela Engert) <https://github.com/DanielaE>`_.
1782
Victor Zverovich372175c2020-07-05 06:06:29 -07001783* Introduced experimental Unicode support
1784 (`#628 <https://github.com/fmtlib/fmt/issues/628>`_,
1785 `#891 <https://github.com/fmtlib/fmt/pull/891>`_):
Victor Zverovichd30bca62020-07-04 17:43:30 -07001786
1787 .. code:: c++
1788
1789 using namespace fmt::literals;
1790 auto s = fmt::format("{:*^5}"_u, "đŸ€Ą"_u); // s == "**đŸ€Ą**"_u
1791
1792* Improved locale support:
1793
1794 .. code:: c++
1795
1796 #include <fmt/locale.h>
1797
1798 struct numpunct : std::numpunct<char> {
1799 protected:
1800 char do_thousands_sep() const override { return '~'; }
1801 };
1802
1803 std::locale loc;
1804 auto s = fmt::format(std::locale(loc, new numpunct()), "{:n}", 1234567);
1805 // s == "1~234~567"
1806
Victor Zverovich372175c2020-07-05 06:06:29 -07001807* Constrained formatting functions on proper iterator types
1808 (`#921 <https://github.com/fmtlib/fmt/pull/921>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07001809 Thanks `@DanielaE (Daniela Engert) <https://github.com/DanielaE>`_.
1810
Victor Zverovich372175c2020-07-05 06:06:29 -07001811* Added ``make_printf_args`` and ``make_wprintf_args`` functions
1812 (`#934 <https://github.com/fmtlib/fmt/pull/934>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07001813 Thanks `@tnovotny <https://github.com/tnovotny>`_.
1814
1815* Deprecated ``fmt::visit``, ``parse_context``, and ``wparse_context``.
1816 Use ``fmt::visit_format_arg``, ``format_parse_context``, and
1817 ``wformat_parse_context`` instead.
1818
1819* Removed undocumented ``basic_fixed_buffer`` which has been superseded by the
Victor Zverovich372175c2020-07-05 06:06:29 -07001820 iterator-based API
1821 (`#873 <https://github.com/fmtlib/fmt/issues/873>`_,
1822 `#902 <https://github.com/fmtlib/fmt/pull/902>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07001823 Thanks `@superfunc (hollywood programmer) <https://github.com/superfunc>`_.
1824
1825* Disallowed repeated leading zeros in an argument ID:
1826
1827 .. code:: c++
1828
1829 fmt::print("{000}", 42); // error
1830
1831* Reintroduced support for gcc 4.4.
1832
Victor Zverovich372175c2020-07-05 06:06:29 -07001833* Fixed compilation on platforms with exotic ``double``
1834 (`#878 <https://github.com/fmtlib/fmt/issues/878>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07001835
Victor Zverovich372175c2020-07-05 06:06:29 -07001836* Improved documentation
1837 (`#164 <https://github.com/fmtlib/fmt/issues/164>`_,
1838 `#877 <https://github.com/fmtlib/fmt/issues/877>`_,
1839 `#901 <https://github.com/fmtlib/fmt/pull/901>`_,
1840 `#906 <https://github.com/fmtlib/fmt/pull/906>`_,
1841 `#979 <https://github.com/fmtlib/fmt/pull/979>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07001842 Thanks `@kookjr (Mathew Cucuzella) <https://github.com/kookjr>`_,
1843 `@DarkDimius (Dmitry Petrashko) <https://github.com/DarkDimius>`_,
1844 `@HecticSerenity <https://github.com/HecticSerenity>`_.
1845
1846* Added pkgconfig support which makes it easier to consume the library from
Victor Zverovich372175c2020-07-05 06:06:29 -07001847 meson and other build systems
1848 (`#916 <https://github.com/fmtlib/fmt/pull/916>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07001849 Thanks `@colemickens (Cole Mickens) <https://github.com/colemickens>`_.
1850
Victor Zverovich372175c2020-07-05 06:06:29 -07001851* Various build improvements
1852 (`#909 <https://github.com/fmtlib/fmt/pull/909>`_,
1853 `#926 <https://github.com/fmtlib/fmt/pull/926>`_,
1854 `#937 <https://github.com/fmtlib/fmt/pull/937>`_,
1855 `#953 <https://github.com/fmtlib/fmt/pull/953>`_,
1856 `#959 <https://github.com/fmtlib/fmt/pull/959>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07001857 Thanks `@tchaikov (Kefu Chai) <https://github.com/tchaikov>`_,
1858 `@luncliff (Park DongHa) <https://github.com/luncliff>`_,
1859 `@AndreasSchoenle (Andreas Schönle) <https://github.com/AndreasSchoenle>`_,
1860 `@hotwatermorning <https://github.com/hotwatermorning>`_,
1861 `@Zefz (JohanJansen) <https://github.com/Zefz>`_.
1862
Victor Zverovich372175c2020-07-05 06:06:29 -07001863* Improved ``string_view`` construction performance
1864 (`#914 <https://github.com/fmtlib/fmt/pull/914>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07001865 Thanks `@gabime (Gabi Melman) <https://github.com/gabime>`_.
1866
Victor Zverovich372175c2020-07-05 06:06:29 -07001867* Fixed non-matching char types
1868 (`#895 <https://github.com/fmtlib/fmt/pull/895>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07001869 Thanks `@DanielaE (Daniela Engert) <https://github.com/DanielaE>`_.
1870
Victor Zverovich372175c2020-07-05 06:06:29 -07001871* Fixed ``format_to_n`` with ``std::back_insert_iterator``
1872 (`#913 <https://github.com/fmtlib/fmt/pull/913>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07001873 Thanks `@DanielaE (Daniela Engert) <https://github.com/DanielaE>`_.
1874
Victor Zverovich372175c2020-07-05 06:06:29 -07001875* Fixed locale-dependent formatting
1876 (`#905 <https://github.com/fmtlib/fmt/issues/905>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07001877
Victor Zverovich372175c2020-07-05 06:06:29 -07001878* Fixed various compiler warnings and errors
1879 (`#882 <https://github.com/fmtlib/fmt/pull/882>`_,
1880 `#886 <https://github.com/fmtlib/fmt/pull/886>`_,
1881 `#933 <https://github.com/fmtlib/fmt/pull/933>`_,
1882 `#941 <https://github.com/fmtlib/fmt/pull/941>`_,
1883 `#931 <https://github.com/fmtlib/fmt/issues/931>`_,
1884 `#943 <https://github.com/fmtlib/fmt/pull/943>`_,
1885 `#954 <https://github.com/fmtlib/fmt/pull/954>`_,
1886 `#956 <https://github.com/fmtlib/fmt/pull/956>`_,
1887 `#962 <https://github.com/fmtlib/fmt/pull/962>`_,
1888 `#965 <https://github.com/fmtlib/fmt/issues/965>`_,
1889 `#977 <https://github.com/fmtlib/fmt/issues/977>`_,
1890 `#983 <https://github.com/fmtlib/fmt/pull/983>`_,
1891 `#989 <https://github.com/fmtlib/fmt/pull/989>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07001892 Thanks `@Luthaf (Guillaume Fraux) <https://github.com/Luthaf>`_,
1893 `@stevenhoving (Steven Hoving) <https://github.com/stevenhoving>`_,
1894 `@christinaa (Kristina Brooks) <https://github.com/christinaa>`_,
1895 `@lgritz (Larry Gritz) <https://github.com/lgritz>`_,
1896 `@DanielaE (Daniela Engert) <https://github.com/DanielaE>`_,
1897 `@0x8000-0000 (Sign Bit) <https://github.com/0x8000-0000>`_,
1898 `@liuping1997 <https://github.com/liuping1997>`_.
1899
19005.2.1 - 2018-09-21
1901------------------
1902
Victor Zverovich372175c2020-07-05 06:06:29 -07001903* Fixed ``visit`` lookup issues on gcc 7 & 8
1904 (`#870 <https://github.com/fmtlib/fmt/pull/870>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07001905 Thanks `@medithe <https://github.com/medithe>`_.
1906
1907* Fixed linkage errors on older gcc.
1908
1909* Prevented ``fmt/range.h`` from specializing ``fmt::basic_string_view``
Victor Zverovich372175c2020-07-05 06:06:29 -07001910 (`#865 <https://github.com/fmtlib/fmt/issues/865>`_,
1911 `#868 <https://github.com/fmtlib/fmt/pull/868>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07001912 Thanks `@hhggit (dual) <https://github.com/hhggit>`_.
1913
Victor Zverovich372175c2020-07-05 06:06:29 -07001914* Improved error message when formatting unknown types
1915 (`#872 <https://github.com/fmtlib/fmt/pull/872>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07001916 Thanks `@foonathan (Jonathan MĂŒller) <https://github.com/foonathan>`_,
1917
Victor Zverovich372175c2020-07-05 06:06:29 -07001918* Disabled templated user-defined literals when compiled under nvcc
1919 (`#875 <https://github.com/fmtlib/fmt/pull/875>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07001920 Thanks `@CandyGumdrop (Candy Gumdrop) <https://github.com/CandyGumdrop>`_,
1921
Victor Zverovich372175c2020-07-05 06:06:29 -07001922* Fixed ``format_to`` formatting to ``wmemory_buffer``
1923 (`#874 <https://github.com/fmtlib/fmt/issues/874>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07001924
19255.2.0 - 2018-09-13
1926------------------
1927
1928* Optimized format string parsing and argument processing which resulted in up
1929 to 5x speed up on long format strings and significant performance boost on
1930 various benchmarks. For example, version 5.2 is 2.22x faster than 5.1 on
1931 decimal integer formatting with ``format_to`` (macOS, clang-902.0.39.2):
1932
1933 ================== ======= =======
1934 Method Time, s Speedup
1935 ================== ======= =======
1936 fmt::format 5.1 0.58
1937 fmt::format 5.2 0.35 1.66x
1938 fmt::format_to 5.1 0.51
1939 fmt::format_to 5.2 0.23 2.22x
1940 sprintf 0.71
1941 std::to_string 1.01
1942 std::stringstream 1.73
1943 ================== ======= =======
1944
1945* Changed the ``fmt`` macro from opt-out to opt-in to prevent name collisions.
1946 To enable it define the ``FMT_STRING_ALIAS`` macro to 1 before including
1947 ``fmt/format.h``:
1948
1949 .. code:: c++
1950
1951 #define FMT_STRING_ALIAS 1
1952 #include <fmt/format.h>
1953 std::string answer = format(fmt("{}"), 42);
1954
1955* Added compile-time format string checks to ``format_to`` overload that takes
Victor Zverovich372175c2020-07-05 06:06:29 -07001956 ``fmt::memory_buffer`` (`#783 <https://github.com/fmtlib/fmt/issues/783>`_):
Victor Zverovichd30bca62020-07-04 17:43:30 -07001957
1958 .. code:: c++
1959
1960 fmt::memory_buffer buf;
1961 // Compile-time error: invalid type specifier.
1962 fmt::format_to(buf, fmt("{:d}"), "foo");
1963
1964* Moved experimental color support to ``fmt/color.h`` and enabled the
1965 new API by default. The old API can be enabled by defining the
1966 ``FMT_DEPRECATED_COLORS`` macro.
1967
1968* Added formatting support for types explicitly convertible to
1969 ``fmt::string_view``:
1970
1971 .. code:: c++
1972
1973 struct foo {
1974 explicit operator fmt::string_view() const { return "foo"; }
1975 };
1976 auto s = format("{}", foo());
1977
1978 In particular, this makes formatting function work with
1979 ``folly::StringPiece``.
1980
1981* Implemented preliminary support for ``char*_t`` by replacing the ``format``
1982 function overloads with a single function template parameterized on the string
1983 type.
1984
Victor Zverovich372175c2020-07-05 06:06:29 -07001985* Added support for dynamic argument lists
1986 (`#814 <https://github.com/fmtlib/fmt/issues/814>`_,
1987 `#819 <https://github.com/fmtlib/fmt/pull/819>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07001988 Thanks `@MikePopoloski (Michael Popoloski)
1989 <https://github.com/MikePopoloski>`_.
1990
1991* Reduced executable size overhead for embedded targets using newlib nano by
Victor Zverovich372175c2020-07-05 06:06:29 -07001992 making locale dependency optional
1993 (`#839 <https://github.com/fmtlib/fmt/pull/839>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07001994 Thanks `@teajay-fr (Thomas Benard) <https://github.com/teajay-fr>`_.
1995
Victor Zverovich372175c2020-07-05 06:06:29 -07001996* Keep ``noexcept`` specifier when exceptions are disabled
1997 (`#801 <https://github.com/fmtlib/fmt/issues/801>`_,
1998 `#810 <https://github.com/fmtlib/fmt/pull/810>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07001999 Thanks `@qis (Alexej Harm) <https://github.com/qis>`_.
2000
2001* Fixed formatting of user-defined types providing ``operator<<`` with
Victor Zverovich372175c2020-07-05 06:06:29 -07002002 ``format_to_n``
2003 (`#806 <https://github.com/fmtlib/fmt/pull/806>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002004 Thanks `@mkurdej (Marek Kurdej) <https://github.com/mkurdej>`_.
2005
Victor Zverovich372175c2020-07-05 06:06:29 -07002006* Fixed dynamic linkage of new symbols
2007 (`#808 <https://github.com/fmtlib/fmt/issues/808>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002008
Victor Zverovich372175c2020-07-05 06:06:29 -07002009* Fixed global initialization issue
2010 (`#807 <https://github.com/fmtlib/fmt/issues/807>`_):
Victor Zverovichd30bca62020-07-04 17:43:30 -07002011
2012 .. code:: c++
2013
2014 // This works on compilers with constexpr support.
2015 static const std::string answer = fmt::format("{}", 42);
2016
Victor Zverovich372175c2020-07-05 06:06:29 -07002017* Fixed various compiler warnings and errors
2018 (`#804 <https://github.com/fmtlib/fmt/pull/804>`_,
2019 `#809 <https://github.com/fmtlib/fmt/issues/809>`_,
2020 `#811 <https://github.com/fmtlib/fmt/pull/811>`_,
2021 `#822 <https://github.com/fmtlib/fmt/issues/822>`_,
2022 `#827 <https://github.com/fmtlib/fmt/pull/827>`_,
2023 `#830 <https://github.com/fmtlib/fmt/issues/830>`_,
2024 `#838 <https://github.com/fmtlib/fmt/pull/838>`_,
2025 `#843 <https://github.com/fmtlib/fmt/issues/843>`_,
2026 `#844 <https://github.com/fmtlib/fmt/pull/844>`_,
2027 `#851 <https://github.com/fmtlib/fmt/issues/851>`_,
2028 `#852 <https://github.com/fmtlib/fmt/pull/852>`_,
2029 `#854 <https://github.com/fmtlib/fmt/pull/854>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002030 Thanks `@henryiii (Henry Schreiner) <https://github.com/henryiii>`_,
2031 `@medithe <https://github.com/medithe>`_, and
2032 `@eliasdaler (Elias Daler) <https://github.com/eliasdaler>`_.
2033
20345.1.0 - 2018-07-05
2035------------------
2036
2037* Added experimental support for RGB color output enabled with
2038 the ``FMT_EXTENDED_COLORS`` macro:
2039
2040 .. code:: c++
2041
2042 #define FMT_EXTENDED_COLORS
2043 #define FMT_HEADER_ONLY // or compile fmt with FMT_EXTENDED_COLORS defined
2044 #include <fmt/format.h>
2045
2046 fmt::print(fmt::color::steel_blue, "Some beautiful text");
2047
2048 The old API (the ``print_colored`` and ``vprint_colored`` functions and the
Victor Zverovich372175c2020-07-05 06:06:29 -07002049 ``color`` enum) is now deprecated.
2050 (`#762 <https://github.com/fmtlib/fmt/issues/762>`_
2051 `#767 <https://github.com/fmtlib/fmt/pull/767>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002052 thanks `@Remotion (Remo) <https://github.com/Remotion>`_.
2053
Victor Zverovich372175c2020-07-05 06:06:29 -07002054* Added quotes to strings in ranges and tuples
2055 (`#766 <https://github.com/fmtlib/fmt/pull/766>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002056 Thanks `@Remotion (Remo) <https://github.com/Remotion>`_.
2057
Victor Zverovich372175c2020-07-05 06:06:29 -07002058* Made ``format_to`` work with ``basic_memory_buffer``
2059 (`#776 <https://github.com/fmtlib/fmt/issues/776>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002060
2061* Added ``vformat_to_n`` and ``wchar_t`` overload of ``format_to_n``
Victor Zverovich372175c2020-07-05 06:06:29 -07002062 (`#764 <https://github.com/fmtlib/fmt/issues/764>`_,
2063 `#769 <https://github.com/fmtlib/fmt/issues/769>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002064
2065* Made ``is_range`` and ``is_tuple_like`` part of public (experimental) API
Victor Zverovich372175c2020-07-05 06:06:29 -07002066 to allow specialization for user-defined types
2067 (`#751 <https://github.com/fmtlib/fmt/issues/751>`_,
2068 `#759 <https://github.com/fmtlib/fmt/pull/759>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002069 Thanks `@drrlvn (Dror Levin) <https://github.com/drrlvn>`_.
2070
2071* Added more compilers to continuous integration and increased ``FMT_PEDANTIC``
Victor Zverovich372175c2020-07-05 06:06:29 -07002072 warning levels
2073 (`#736 <https://github.com/fmtlib/fmt/pull/736>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002074 Thanks `@eliaskosunen (Elias Kosunen) <https://github.com/eliaskosunen>`_.
2075
2076* Fixed compilation with MSVC 2013.
2077
Victor Zverovich372175c2020-07-05 06:06:29 -07002078* Fixed handling of user-defined types in ``format_to``
2079 (`#793 <https://github.com/fmtlib/fmt/issues/793>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002080
Victor Zverovich372175c2020-07-05 06:06:29 -07002081* Forced linking of inline ``vformat`` functions into the library
2082 (`#795 <https://github.com/fmtlib/fmt/issues/795>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002083
Victor Zverovich372175c2020-07-05 06:06:29 -07002084* Fixed incorrect call to on_align in ``'{:}='``
2085 (`#750 <https://github.com/fmtlib/fmt/issues/750>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002086
2087* Fixed floating-point formatting to a non-back_insert_iterator with sign &
Victor Zverovich372175c2020-07-05 06:06:29 -07002088 numeric alignment specified
2089 (`#756 <https://github.com/fmtlib/fmt/issues/756>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002090
Victor Zverovich372175c2020-07-05 06:06:29 -07002091* Fixed formatting to an array with ``format_to_n``
2092 (`#778 <https://github.com/fmtlib/fmt/issues/778>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002093
Victor Zverovich372175c2020-07-05 06:06:29 -07002094* Fixed formatting of more than 15 named arguments
2095 (`#754 <https://github.com/fmtlib/fmt/issues/754>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002096
2097* Fixed handling of compile-time strings when including ``fmt/ostream.h``.
Victor Zverovich372175c2020-07-05 06:06:29 -07002098 (`#768 <https://github.com/fmtlib/fmt/issues/768>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002099
Victor Zverovich372175c2020-07-05 06:06:29 -07002100* Fixed various compiler warnings and errors
2101 (`#742 <https://github.com/fmtlib/fmt/issues/742>`_,
2102 `#748 <https://github.com/fmtlib/fmt/issues/748>`_,
2103 `#752 <https://github.com/fmtlib/fmt/issues/752>`_,
2104 `#770 <https://github.com/fmtlib/fmt/issues/770>`_,
2105 `#775 <https://github.com/fmtlib/fmt/pull/775>`_,
2106 `#779 <https://github.com/fmtlib/fmt/issues/779>`_,
2107 `#780 <https://github.com/fmtlib/fmt/pull/780>`_,
2108 `#790 <https://github.com/fmtlib/fmt/pull/790>`_,
2109 `#792 <https://github.com/fmtlib/fmt/pull/792>`_,
2110 `#800 <https://github.com/fmtlib/fmt/pull/800>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002111 Thanks `@Remotion (Remo) <https://github.com/Remotion>`_,
2112 `@gabime (Gabi Melman) <https://github.com/gabime>`_,
2113 `@foonathan (Jonathan MĂŒller) <https://github.com/foonathan>`_,
2114 `@Dark-Passenger (Dhruv Paranjape) <https://github.com/Dark-Passenger>`_, and
2115 `@0x8000-0000 (Sign Bit) <https://github.com/0x8000-0000>`_.
2116
21175.0.0 - 2018-05-21
2118------------------
2119
2120* Added a requirement for partial C++11 support, most importantly variadic
2121 templates and type traits, and dropped ``FMT_VARIADIC_*`` emulation macros.
2122 Variadic templates are available since GCC 4.4, Clang 2.9 and MSVC 18.0 (2013).
2123 For older compilers use {fmt} `version 4.x
2124 <https://github.com/fmtlib/fmt/releases/tag/4.1.0>`_ which continues to be
2125 maintained and works with C++98 compilers.
2126
2127* Renamed symbols to follow standard C++ naming conventions and proposed a subset
2128 of the library for standardization in `P0645R2 Text Formatting
2129 <https://wg21.link/P0645>`_.
2130
2131* Implemented ``constexpr`` parsing of format strings and `compile-time format
2132 string checks
Victor Zverovichcd465112020-10-24 09:24:47 -07002133 <https://fmt.dev/latest/api.html#compile-time-format-string-checks>`_. For
Victor Zverovichd30bca62020-07-04 17:43:30 -07002134 example
2135
2136 .. code:: c++
2137
2138 #include <fmt/format.h>
2139
2140 std::string s = format(fmt("{:d}"), "foo");
2141
2142 gives a compile-time error because ``d`` is an invalid specifier for strings
2143 (`godbolt <https://godbolt.org/g/rnCy9Q>`__)::
2144
2145 ...
2146 <source>:4:19: note: in instantiation of function template specialization 'fmt::v5::format<S, char [4]>' requested here
2147 std::string s = format(fmt("{:d}"), "foo");
2148 ^
2149 format.h:1337:13: note: non-constexpr function 'on_error' cannot be used in a constant expression
2150 handler.on_error("invalid type specifier");
2151
2152 Compile-time checks require relaxed ``constexpr`` (C++14 feature) support. If
2153 the latter is not available, checks will be performed at runtime.
2154
2155* Separated format string parsing and formatting in the extension API to enable
2156 compile-time format string processing. For example
2157
2158 .. code:: c++
2159
2160 struct Answer {};
2161
2162 namespace fmt {
2163 template <>
2164 struct formatter<Answer> {
2165 constexpr auto parse(parse_context& ctx) {
2166 auto it = ctx.begin();
2167 spec = *it;
2168 if (spec != 'd' && spec != 's')
2169 throw format_error("invalid specifier");
2170 return ++it;
2171 }
2172
2173 template <typename FormatContext>
2174 auto format(Answer, FormatContext& ctx) {
2175 return spec == 's' ?
2176 format_to(ctx.begin(), "{}", "fourty-two") :
2177 format_to(ctx.begin(), "{}", 42);
2178 }
2179
2180 char spec = 0;
2181 };
2182 }
2183
2184 std::string s = format(fmt("{:x}"), Answer());
2185
2186 gives a compile-time error due to invalid format specifier (`godbolt
2187 <https://godbolt.org/g/2jQ1Dv>`__)::
2188
2189 ...
2190 <source>:12:45: error: expression '<throw-expression>' is not a constant expression
2191 throw format_error("invalid specifier");
2192
2193* Added `iterator support
Victor Zverovichcd465112020-10-24 09:24:47 -07002194 <https://fmt.dev/latest/api.html#output-iterator-support>`_:
Victor Zverovichd30bca62020-07-04 17:43:30 -07002195
2196 .. code:: c++
2197
2198 #include <vector>
2199 #include <fmt/format.h>
2200
2201 std::vector<char> out;
2202 fmt::format_to(std::back_inserter(out), "{}", 42);
2203
2204* Added the `format_to_n
Victor Zverovichcd465112020-10-24 09:24:47 -07002205 <https://fmt.dev/latest/api.html#_CPPv2N3fmt11format_to_nE8OutputItNSt6size_tE11string_viewDpRK4Args>`_
Victor Zverovichd30bca62020-07-04 17:43:30 -07002206 function that restricts the output to the specified number of characters
Victor Zverovich372175c2020-07-05 06:06:29 -07002207 (`#298 <https://github.com/fmtlib/fmt/issues/298>`_):
Victor Zverovichd30bca62020-07-04 17:43:30 -07002208
2209 .. code:: c++
2210
2211 char out[4];
2212 fmt::format_to_n(out, sizeof(out), "{}", 12345);
2213 // out == "1234" (without terminating '\0')
2214
2215* Added the `formatted_size
Victor Zverovichcd465112020-10-24 09:24:47 -07002216 <https://fmt.dev/latest/api.html#_CPPv2N3fmt14formatted_sizeE11string_viewDpRK4Args>`_
Victor Zverovichd30bca62020-07-04 17:43:30 -07002217 function for computing the output size:
2218
2219 .. code:: c++
2220
2221 #include <fmt/format.h>
2222
2223 auto size = fmt::formatted_size("{}", 12345); // size == 5
2224
2225* Improved compile times by reducing dependencies on standard headers and
Victor Zverovichcd465112020-10-24 09:24:47 -07002226 providing a lightweight `core API <https://fmt.dev/latest/api.html#core-api>`_:
Victor Zverovichd30bca62020-07-04 17:43:30 -07002227
2228 .. code:: c++
2229
2230 #include <fmt/core.h>
2231
2232 fmt::print("The answer is {}.", 42);
2233
2234 See `Compile time and code bloat
2235 <https://github.com/fmtlib/fmt#compile-time-and-code-bloat>`_.
2236
2237* Added the `make_format_args
Victor Zverovichcd465112020-10-24 09:24:47 -07002238 <https://fmt.dev/latest/api.html#_CPPv2N3fmt16make_format_argsEDpRK4Args>`_
Victor Zverovichd30bca62020-07-04 17:43:30 -07002239 function for capturing formatting arguments:
2240
2241 .. code:: c++
2242
2243 // Prints formatted error message.
2244 void vreport_error(const char *format, fmt::format_args args) {
2245 fmt::print("Error: ");
2246 fmt::vprint(format, args);
2247 }
2248 template <typename... Args>
2249 void report_error(const char *format, const Args & ... args) {
2250 vreport_error(format, fmt::make_format_args(args...));
2251 }
2252
2253* Added the ``make_printf_args`` function for capturing ``printf`` arguments
Victor Zverovich372175c2020-07-05 06:06:29 -07002254 (`#687 <https://github.com/fmtlib/fmt/issues/687>`_,
2255 `#694 <https://github.com/fmtlib/fmt/pull/694>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002256 Thanks `@Kronuz (GermĂĄn MĂ©ndez Bravo) <https://github.com/Kronuz>`_.
2257
2258* Added prefix ``v`` to non-variadic functions taking ``format_args`` to
2259 distinguish them from variadic ones:
2260
2261 .. code:: c++
2262
2263 std::string vformat(string_view format_str, format_args args);
2264
2265 template <typename... Args>
2266 std::string format(string_view format_str, const Args & ... args);
2267
2268* Added experimental support for formatting ranges, containers and tuple-like
Victor Zverovich372175c2020-07-05 06:06:29 -07002269 types in ``fmt/ranges.h`` (`#735 <https://github.com/fmtlib/fmt/pull/735>`_):
Victor Zverovichd30bca62020-07-04 17:43:30 -07002270
2271 .. code:: c++
2272
2273 #include <fmt/ranges.h>
2274
2275 std::vector<int> v = {1, 2, 3};
2276 fmt::print("{}", v); // prints {1, 2, 3}
2277
2278 Thanks `@Remotion (Remo) <https://github.com/Remotion>`_.
2279
Victor Zverovich372175c2020-07-05 06:06:29 -07002280* Implemented ``wchar_t`` date and time formatting
2281 (`#712 <https://github.com/fmtlib/fmt/pull/712>`_):
Victor Zverovichd30bca62020-07-04 17:43:30 -07002282
2283 .. code:: c++
2284
2285 #include <fmt/time.h>
2286
2287 std::time_t t = std::time(nullptr);
2288 auto s = fmt::format(L"The date is {:%Y-%m-%d}.", *std::localtime(&t));
2289
2290 Thanks `@DanielaE (Daniela Engert) <https://github.com/DanielaE>`_.
2291
Victor Zverovich372175c2020-07-05 06:06:29 -07002292* Provided more wide string overloads
2293 (`#724 <https://github.com/fmtlib/fmt/pull/724>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002294 Thanks `@DanielaE (Daniela Engert) <https://github.com/DanielaE>`_.
2295
2296* Switched from a custom null-terminated string view class to ``string_view``
2297 in the format API and provided ``fmt::string_view`` which implements a subset
2298 of ``std::string_view`` API for pre-C++17 systems.
2299
Victor Zverovich372175c2020-07-05 06:06:29 -07002300* Added support for ``std::experimental::string_view``
2301 (`#607 <https://github.com/fmtlib/fmt/pull/607>`_):
Victor Zverovichd30bca62020-07-04 17:43:30 -07002302
2303 .. code:: c++
2304
2305 #include <fmt/core.h>
2306 #include <experimental/string_view>
2307
2308 fmt::print("{}", std::experimental::string_view("foo"));
2309
2310 Thanks `@virgiliofornazin (Virgilio Alexandre Fornazin)
2311 <https://github.com/virgiliofornazin>`__.
2312
2313* Allowed mixing named and automatic arguments:
2314
2315 .. code:: c++
2316
2317 fmt::format("{} {two}", 1, fmt::arg("two", 2));
2318
2319* Removed the write API in favor of the `format API
Victor Zverovichcd465112020-10-24 09:24:47 -07002320 <https://fmt.dev/latest/api.html#format-api>`_ with compile-time handling of
Victor Zverovichd30bca62020-07-04 17:43:30 -07002321 format strings.
2322
2323* Disallowed formatting of multibyte strings into a wide character target
Victor Zverovich372175c2020-07-05 06:06:29 -07002324 (`#606 <https://github.com/fmtlib/fmt/pull/606>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002325
Victor Zverovich372175c2020-07-05 06:06:29 -07002326* Improved documentation
2327 (`#515 <https://github.com/fmtlib/fmt/pull/515>`_,
2328 `#614 <https://github.com/fmtlib/fmt/issues/614>`_,
2329 `#617 <https://github.com/fmtlib/fmt/pull/617>`_,
2330 `#661 <https://github.com/fmtlib/fmt/pull/661>`_,
2331 `#680 <https://github.com/fmtlib/fmt/pull/680>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002332 Thanks `@ibell (Ian Bell) <https://github.com/ibell>`_,
2333 `@mihaitodor (Mihai Todor) <https://github.com/mihaitodor>`_, and
2334 `@johnthagen <https://github.com/johnthagen>`_.
2335
2336* Implemented more efficient handling of large number of format arguments.
2337
2338* Introduced an inline namespace for symbol versioning.
2339
Victor Zverovich372175c2020-07-05 06:06:29 -07002340* Added debug postfix ``d`` to the ``fmt`` library name
2341 (`#636 <https://github.com/fmtlib/fmt/issues/636>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002342
Victor Zverovich372175c2020-07-05 06:06:29 -07002343* Removed unnecessary ``fmt/`` prefix in includes
2344 (`#397 <https://github.com/fmtlib/fmt/pull/397>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002345 Thanks `@chronoxor (Ivan Shynkarenka) <https://github.com/chronoxor>`_.
2346
2347* Moved ``fmt/*.h`` to ``include/fmt/*.h`` to prevent irrelevant files and
2348 directories appearing on the include search paths when fmt is used as a
2349 subproject and moved source files to the ``src`` directory.
2350
Victor Zverovich372175c2020-07-05 06:06:29 -07002351* Added qmake project file ``support/fmt.pro``
2352 (`#641 <https://github.com/fmtlib/fmt/pull/641>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002353 Thanks `@cowo78 (Giuseppe Corbelli) <https://github.com/cowo78>`_.
2354
Victor Zverovich372175c2020-07-05 06:06:29 -07002355* Added Gradle build file ``support/build.gradle``
2356 (`#649 <https://github.com/fmtlib/fmt/pull/649>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002357 Thanks `@luncliff (Park DongHa) <https://github.com/luncliff>`_.
2358
2359* Removed ``FMT_CPPFORMAT`` CMake option.
2360
Victor Zverovich372175c2020-07-05 06:06:29 -07002361* Fixed a name conflict with the macro ``CHAR_WIDTH`` in glibc
2362 (`#616 <https://github.com/fmtlib/fmt/pull/616>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002363 Thanks `@aroig (AbdĂł Roig-Maranges) <https://github.com/aroig>`_.
2364
Victor Zverovich372175c2020-07-05 06:06:29 -07002365* Fixed handling of nested braces in ``fmt::join``
2366 (`#638 <https://github.com/fmtlib/fmt/issues/638>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002367
Victor Zverovich372175c2020-07-05 06:06:29 -07002368* Added ``SOURCELINK_SUFFIX`` for compatibility with Sphinx 1.5
2369 (`#497 <https://github.com/fmtlib/fmt/pull/497>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002370 Thanks `@ginggs (Graham Inggs) <https://github.com/ginggs>`_.
2371
Victor Zverovich372175c2020-07-05 06:06:29 -07002372* Added a missing ``inline`` in the header-only mode
2373 (`#626 <https://github.com/fmtlib/fmt/pull/626>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002374 Thanks `@aroig (AbdĂł Roig-Maranges) <https://github.com/aroig>`_.
2375
Victor Zverovich372175c2020-07-05 06:06:29 -07002376* Fixed various compiler warnings
2377 (`#640 <https://github.com/fmtlib/fmt/pull/640>`_,
2378 `#656 <https://github.com/fmtlib/fmt/pull/656>`_,
2379 `#679 <https://github.com/fmtlib/fmt/pull/679>`_,
2380 `#681 <https://github.com/fmtlib/fmt/pull/681>`_,
2381 `#705 <https://github.com/fmtlib/fmt/pull/705>`__,
2382 `#715 <https://github.com/fmtlib/fmt/issues/715>`_,
2383 `#717 <https://github.com/fmtlib/fmt/pull/717>`_,
2384 `#720 <https://github.com/fmtlib/fmt/pull/720>`_,
2385 `#723 <https://github.com/fmtlib/fmt/pull/723>`_,
2386 `#726 <https://github.com/fmtlib/fmt/pull/726>`_,
2387 `#730 <https://github.com/fmtlib/fmt/pull/730>`_,
2388 `#739 <https://github.com/fmtlib/fmt/pull/739>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002389 Thanks `@peterbell10 <https://github.com/peterbell10>`_,
2390 `@LarsGullik <https://github.com/LarsGullik>`_,
2391 `@foonathan (Jonathan MĂŒller) <https://github.com/foonathan>`_,
2392 `@eliaskosunen (Elias Kosunen) <https://github.com/eliaskosunen>`_,
Victor Zverovich372175c2020-07-05 06:06:29 -07002393 `@christianparpart (Christian Parpart) <https://github.com/christianparpart>`_,
Victor Zverovichd30bca62020-07-04 17:43:30 -07002394 `@DanielaE (Daniela Engert) <https://github.com/DanielaE>`_,
2395 and `@mwinterb <https://github.com/mwinterb>`_.
2396
Victor Zverovich372175c2020-07-05 06:06:29 -07002397* Worked around an MSVC bug and fixed several warnings
2398 (`#653 <https://github.com/fmtlib/fmt/pull/653>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002399 Thanks `@alabuzhev (Alex Alabuzhev) <https://github.com/alabuzhev>`_.
2400
Victor Zverovich372175c2020-07-05 06:06:29 -07002401* Worked around GCC bug 67371
2402 (`#682 <https://github.com/fmtlib/fmt/issues/682>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002403
Victor Zverovich372175c2020-07-05 06:06:29 -07002404* Fixed compilation with ``-fno-exceptions``
2405 (`#655 <https://github.com/fmtlib/fmt/pull/655>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002406 Thanks `@chenxiaolong (Andrew Gunnerson) <https://github.com/chenxiaolong>`_.
2407
Victor Zverovich372175c2020-07-05 06:06:29 -07002408* Made ``constexpr remove_prefix`` gcc version check tighter
2409 (`#648 <https://github.com/fmtlib/fmt/issues/648>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002410
2411* Renamed internal type enum constants to prevent collision with poorly written
Victor Zverovich372175c2020-07-05 06:06:29 -07002412 C libraries (`#644 <https://github.com/fmtlib/fmt/issues/644>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002413
Victor Zverovich372175c2020-07-05 06:06:29 -07002414* Added detection of ``wostream operator<<``
2415 (`#650 <https://github.com/fmtlib/fmt/issues/650>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002416
Victor Zverovich372175c2020-07-05 06:06:29 -07002417* Fixed compilation on OpenBSD
2418 (`#660 <https://github.com/fmtlib/fmt/pull/660>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002419 Thanks `@hubslave <https://github.com/hubslave>`_.
2420
Victor Zverovich372175c2020-07-05 06:06:29 -07002421* Fixed compilation on FreeBSD 12
2422 (`#732 <https://github.com/fmtlib/fmt/pull/732>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002423 Thanks `@dankm <https://github.com/dankm>`_.
2424
2425* Fixed compilation when there is a mismatch between ``-std`` options between
Victor Zverovich372175c2020-07-05 06:06:29 -07002426 the library and user code
2427 (`#664 <https://github.com/fmtlib/fmt/issues/664>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002428
Victor Zverovich372175c2020-07-05 06:06:29 -07002429* Fixed compilation with GCC 7 and ``-std=c++11``
2430 (`#734 <https://github.com/fmtlib/fmt/issues/734>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002431
Victor Zverovich372175c2020-07-05 06:06:29 -07002432* Improved generated binary code on GCC 7 and older
2433 (`#668 <https://github.com/fmtlib/fmt/issues/668>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002434
Victor Zverovich372175c2020-07-05 06:06:29 -07002435* Fixed handling of numeric alignment with no width
2436 (`#675 <https://github.com/fmtlib/fmt/issues/675>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002437
Victor Zverovich372175c2020-07-05 06:06:29 -07002438* Fixed handling of empty strings in UTF8/16 converters
2439 (`#676 <https://github.com/fmtlib/fmt/pull/676>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002440 Thanks `@vgalka-sl (Vasili Galka) <https://github.com/vgalka-sl>`_.
2441
Victor Zverovich372175c2020-07-05 06:06:29 -07002442* Fixed formatting of an empty ``string_view``
2443 (`#689 <https://github.com/fmtlib/fmt/issues/689>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002444
Victor Zverovich372175c2020-07-05 06:06:29 -07002445* Fixed detection of ``string_view`` on libc++
2446 (`#686 <https://github.com/fmtlib/fmt/issues/686>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002447
Victor Zverovich372175c2020-07-05 06:06:29 -07002448* Fixed DLL issues (`#696 <https://github.com/fmtlib/fmt/pull/696>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002449 Thanks `@sebkoenig <https://github.com/sebkoenig>`_.
2450
Victor Zverovich372175c2020-07-05 06:06:29 -07002451* Fixed compile checks for mixing narrow and wide strings
2452 (`#690 <https://github.com/fmtlib/fmt/issues/690>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002453
Victor Zverovich372175c2020-07-05 06:06:29 -07002454* Disabled unsafe implicit conversion to ``std::string``
2455 (`#729 <https://github.com/fmtlib/fmt/issues/729>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002456
2457* Fixed handling of reused format specs (as in ``fmt::join``) for pointers
Victor Zverovich372175c2020-07-05 06:06:29 -07002458 (`#725 <https://github.com/fmtlib/fmt/pull/725>`_).
2459 Thanks `@mwinterb <https://github.com/mwinterb>`_.
Victor Zverovichd30bca62020-07-04 17:43:30 -07002460
Victor Zverovich372175c2020-07-05 06:06:29 -07002461* Fixed installation of ``fmt/ranges.h``
2462 (`#738 <https://github.com/fmtlib/fmt/pull/738>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002463 Thanks `@sv1990 <https://github.com/sv1990>`_.
2464
24654.1.0 - 2017-12-20
2466------------------
2467
Victor Zverovich372175c2020-07-05 06:06:29 -07002468* Added ``fmt::to_wstring()`` in addition to ``fmt::to_string()``
2469 (`#559 <https://github.com/fmtlib/fmt/pull/559>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002470 Thanks `@alabuzhev (Alex Alabuzhev) <https://github.com/alabuzhev>`_.
2471
Victor Zverovich372175c2020-07-05 06:06:29 -07002472* Added support for C++17 ``std::string_view``
2473 (`#571 <https://github.com/fmtlib/fmt/pull/571>`_ and
2474 `#578 <https://github.com/fmtlib/fmt/pull/578>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002475 Thanks `@thelostt (MĂĄrio Feroldi) <https://github.com/thelostt>`_ and
2476 `@mwinterb <https://github.com/mwinterb>`_.
2477
Victor Zverovich372175c2020-07-05 06:06:29 -07002478* Enabled stream exceptions to catch errors
2479 (`#581 <https://github.com/fmtlib/fmt/issues/581>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002480 Thanks `@crusader-mike <https://github.com/crusader-mike>`_.
2481
Victor Zverovich372175c2020-07-05 06:06:29 -07002482* Allowed formatting of class hierarchies with ``fmt::format_arg()``
2483 (`#547 <https://github.com/fmtlib/fmt/pull/547>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002484 Thanks `@rollbear (Björn Fahller) <https://github.com/rollbear>`_.
2485
Victor Zverovich372175c2020-07-05 06:06:29 -07002486* Removed limitations on character types
2487 (`#563 <https://github.com/fmtlib/fmt/pull/563>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002488 Thanks `@Yelnats321 (Elnar Dakeshov) <https://github.com/Yelnats321>`_.
2489
Victor Zverovich372175c2020-07-05 06:06:29 -07002490* Conditionally enabled use of ``std::allocator_traits``
2491 (`#583 <https://github.com/fmtlib/fmt/pull/583>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002492 Thanks `@mwinterb <https://github.com/mwinterb>`_.
2493
2494* Added support for ``const`` variadic member function emulation with
Victor Zverovich372175c2020-07-05 06:06:29 -07002495 ``FMT_VARIADIC_CONST`` (`#591 <https://github.com/fmtlib/fmt/pull/591>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002496 Thanks `@ludekvodicka (Ludek Vodicka) <https://github.com/ludekvodicka>`_.
2497
2498* Various bugfixes: bad overflow check, unsupported implicit type conversion
Victor Zverovich372175c2020-07-05 06:06:29 -07002499 when determining formatting function, test segfaults
2500 (`#551 <https://github.com/fmtlib/fmt/issues/551>`_), ill-formed macros
2501 (`#542 <https://github.com/fmtlib/fmt/pull/542>`_) and ambiguous overloads
2502 (`#580 <https://github.com/fmtlib/fmt/issues/580>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002503 Thanks `@xylosper (Byoung-young Lee) <https://github.com/xylosper>`_.
2504
Victor Zverovich372175c2020-07-05 06:06:29 -07002505* Prevented warnings on MSVC (`#605 <https://github.com/fmtlib/fmt/pull/605>`_,
2506 `#602 <https://github.com/fmtlib/fmt/pull/602>`_, and
2507 `#545 <https://github.com/fmtlib/fmt/pull/545>`_),
2508 clang (`#582 <https://github.com/fmtlib/fmt/pull/582>`_),
2509 GCC (`#573 <https://github.com/fmtlib/fmt/issues/573>`_),
2510 various conversion warnings (`#609 <https://github.com/fmtlib/fmt/pull/609>`_,
2511 `#567 <https://github.com/fmtlib/fmt/pull/567>`_,
2512 `#553 <https://github.com/fmtlib/fmt/pull/553>`_ and
2513 `#553 <https://github.com/fmtlib/fmt/pull/553>`_), and added ``override`` and
2514 ``[[noreturn]]`` (`#549 <https://github.com/fmtlib/fmt/pull/549>`_ and
2515 `#555 <https://github.com/fmtlib/fmt/issues/555>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002516 Thanks `@alabuzhev (Alex Alabuzhev) <https://github.com/alabuzhev>`_,
2517 `@virgiliofornazin (Virgilio Alexandre Fornazin)
2518 <https://gihtub.com/virgiliofornazin>`_,
2519 `@alexanderbock (Alexander Bock) <https://github.com/alexanderbock>`_,
2520 `@yumetodo <https://github.com/yumetodo>`_,
2521 `@VaderY (CsĂĄszĂĄr MĂĄtyĂĄs) <https://github.com/VaderY>`_,
2522 `@jpcima (JP Cimalando) <https://github.com/jpcima>`_,
2523 `@thelostt (MĂĄrio Feroldi) <https://github.com/thelostt>`_, and
2524 `@Manu343726 (Manu SĂĄnchez) <https://github.com/Manu343726>`_.
2525
2526* Improved CMake: Used ``GNUInstallDirs`` to set installation location
Victor Zverovich372175c2020-07-05 06:06:29 -07002527 (`#610 <https://github.com/fmtlib/fmt/pull/610>`_) and fixed warnings
2528 (`#536 <https://github.com/fmtlib/fmt/pull/536>`_ and
2529 `#556 <https://github.com/fmtlib/fmt/pull/556>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002530 Thanks `@mikecrowe (Mike Crowe) <https://github.com/mikecrowe>`_,
2531 `@evgen231 <https://github.com/evgen231>`_ and
2532 `@henryiii (Henry Schreiner) <https://github.com/henryiii>`_.
2533
25344.0.0 - 2017-06-27
2535------------------
2536
2537* Removed old compatibility headers ``cppformat/*.h`` and CMake options
Victor Zverovich372175c2020-07-05 06:06:29 -07002538 (`#527 <https://github.com/fmtlib/fmt/pull/527>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002539 Thanks `@maddinat0r (Alex Martin) <https://github.com/maddinat0r>`_.
2540
2541* Added ``string.h`` containing ``fmt::to_string()`` as alternative to
2542 ``std::to_string()`` as well as other string writer functionality
Victor Zverovich372175c2020-07-05 06:06:29 -07002543 (`#326 <https://github.com/fmtlib/fmt/issues/326>`_ and
2544 `#441 <https://github.com/fmtlib/fmt/pull/441>`_):
Victor Zverovichd30bca62020-07-04 17:43:30 -07002545
2546 .. code:: c++
2547
2548 #include "fmt/string.h"
2549
2550 std::string answer = fmt::to_string(42);
2551
2552 Thanks to `@glebov-andrey (Andrey Glebov)
2553 <https://github.com/glebov-andrey>`_.
2554
2555* Moved ``fmt::printf()`` to new ``printf.h`` header and allowed ``%s`` as
Victor Zverovich372175c2020-07-05 06:06:29 -07002556 generic specifier (`#453 <https://github.com/fmtlib/fmt/pull/453>`_),
2557 made ``%.f`` more conformant to regular ``printf()``
2558 (`#490 <https://github.com/fmtlib/fmt/pull/490>`_), added custom writer
2559 support (`#476 <https://github.com/fmtlib/fmt/issues/476>`_) and implemented
2560 missing custom argument formatting
2561 (`#339 <https://github.com/fmtlib/fmt/pull/339>`_ and
2562 `#340 <https://github.com/fmtlib/fmt/pull/340>`_):
Victor Zverovichd30bca62020-07-04 17:43:30 -07002563
2564 .. code:: c++
2565
2566 #include "fmt/printf.h"
2567
2568 // %s format specifier can be used with any argument type.
2569 fmt::printf("%s", 42);
2570
2571 Thanks `@mojoBrendan <https://github.com/mojoBrendan>`_,
2572 `@manylegged (Arthur Danskin) <https://github.com/manylegged>`_ and
2573 `@spacemoose (Glen Stark) <https://github.com/spacemoose>`_.
Victor Zverovich372175c2020-07-05 06:06:29 -07002574 See also `#360 <https://github.com/fmtlib/fmt/issues/360>`_,
2575 `#335 <https://github.com/fmtlib/fmt/issues/335>`_ and
2576 `#331 <https://github.com/fmtlib/fmt/issues/331>`_.
Victor Zverovichd30bca62020-07-04 17:43:30 -07002577
2578* Added ``container.h`` containing a ``BasicContainerWriter``
Victor Zverovich372175c2020-07-05 06:06:29 -07002579 to write to containers like ``std::vector``
2580 (`#450 <https://github.com/fmtlib/fmt/pull/450>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002581 Thanks `@polyvertex (Jean-Charles Lefebvre) <https://github.com/polyvertex>`_.
2582
2583* Added ``fmt::join()`` function that takes a range and formats
Victor Zverovich372175c2020-07-05 06:06:29 -07002584 its elements separated by a given string
2585 (`#466 <https://github.com/fmtlib/fmt/pull/466>`_):
Victor Zverovichd30bca62020-07-04 17:43:30 -07002586
2587 .. code:: c++
2588
2589 #include "fmt/format.h"
2590
2591 std::vector<double> v = {1.2, 3.4, 5.6};
2592 // Prints "(+01.20, +03.40, +05.60)".
2593 fmt::print("({:+06.2f})", fmt::join(v.begin(), v.end(), ", "));
2594
2595 Thanks `@olivier80 <https://github.com/olivier80>`_.
2596
2597* Added support for custom formatting specifications to simplify customization
Victor Zverovich372175c2020-07-05 06:06:29 -07002598 of built-in formatting (`#444 <https://github.com/fmtlib/fmt/pull/444>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002599 Thanks `@polyvertex (Jean-Charles Lefebvre) <https://github.com/polyvertex>`_.
Victor Zverovich372175c2020-07-05 06:06:29 -07002600 See also `#439 <https://github.com/fmtlib/fmt/issues/439>`_.
Victor Zverovichd30bca62020-07-04 17:43:30 -07002601
2602* Added ``fmt::format_system_error()`` for error code formatting
Victor Zverovich372175c2020-07-05 06:06:29 -07002603 (`#323 <https://github.com/fmtlib/fmt/issues/323>`_ and
2604 `#526 <https://github.com/fmtlib/fmt/pull/526>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002605 Thanks `@maddinat0r (Alex Martin) <https://github.com/maddinat0r>`_.
2606
2607* Added thread-safe ``fmt::localtime()`` and ``fmt::gmtime()``
Victor Zverovich372175c2020-07-05 06:06:29 -07002608 as replacement for the standard version to ``time.h``
2609 (`#396 <https://github.com/fmtlib/fmt/pull/396>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002610 Thanks `@codicodi <https://github.com/codicodi>`_.
2611
Victor Zverovich372175c2020-07-05 06:06:29 -07002612* Internal improvements to ``NamedArg`` and ``ArgLists``
2613 (`#389 <https://github.com/fmtlib/fmt/pull/389>`_ and
2614 `#390 <https://github.com/fmtlib/fmt/pull/390>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002615 Thanks `@chronoxor <https://github.com/chronoxor>`_.
2616
Victor Zverovich372175c2020-07-05 06:06:29 -07002617* Fixed crash due to bug in ``FormatBuf``
2618 (`#493 <https://github.com/fmtlib/fmt/pull/493>`_).
2619 Thanks `@effzeh <https://github.com/effzeh>`_. See also
2620 `#480 <https://github.com/fmtlib/fmt/issues/480>`_ and
2621 `#491 <https://github.com/fmtlib/fmt/issues/491>`_.
Victor Zverovichd30bca62020-07-04 17:43:30 -07002622
2623* Fixed handling of wide strings in ``fmt::StringWriter``.
2624
Victor Zverovich372175c2020-07-05 06:06:29 -07002625* Improved compiler error messages
2626 (`#357 <https://github.com/fmtlib/fmt/issues/357>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002627
2628* Fixed various warnings and issues with various compilers
Victor Zverovich372175c2020-07-05 06:06:29 -07002629 (`#494 <https://github.com/fmtlib/fmt/pull/494>`_,
2630 `#499 <https://github.com/fmtlib/fmt/pull/499>`_,
2631 `#483 <https://github.com/fmtlib/fmt/pull/483>`_,
2632 `#485 <https://github.com/fmtlib/fmt/pull/485>`_,
2633 `#482 <https://github.com/fmtlib/fmt/pull/482>`_,
2634 `#475 <https://github.com/fmtlib/fmt/pull/475>`_,
2635 `#473 <https://github.com/fmtlib/fmt/pull/473>`_ and
2636 `#414 <https://github.com/fmtlib/fmt/pull/414>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002637 Thanks `@chronoxor <https://github.com/chronoxor>`_,
2638 `@zhaohuaxishi <https://github.com/zhaohuaxishi>`_,
2639 `@pkestene (Pierre Kestener) <https://github.com/pkestene>`_,
2640 `@dschmidt (Dominik Schmidt) <https://github.com/dschmidt>`_ and
2641 `@0x414c (Alexey Gorishny) <https://github.com/0x414c>`_ .
2642
Victor Zverovich372175c2020-07-05 06:06:29 -07002643* Improved CMake: targets are now namespaced
2644 (`#511 <https://github.com/fmtlib/fmt/pull/511>`_ and
2645 `#513 <https://github.com/fmtlib/fmt/pull/513>`_), supported header-only
2646 ``printf.h`` (`#354 <https://github.com/fmtlib/fmt/pull/354>`_), fixed issue
2647 with minimal supported library subset
2648 (`#418 <https://github.com/fmtlib/fmt/issues/418>`_,
2649 `#419 <https://github.com/fmtlib/fmt/pull/419>`_ and
2650 `#420 <https://github.com/fmtlib/fmt/pull/420>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002651 Thanks `@bjoernthiel (Bjoern Thiel) <https://github.com/bjoernthiel>`_,
2652 `@niosHD (Mario Werner) <https://github.com/niosHD>`_,
2653 `@LogicalKnight (Sean LK) <https://github.com/LogicalKnight>`_ and
2654 `@alabuzhev (Alex Alabuzhev) <https://github.com/alabuzhev>`_.
2655
2656* Improved documentation. Thanks to
Victor Zverovich372175c2020-07-05 06:06:29 -07002657 `@pwm1234 (Phil) <https://github.com/pwm1234>`_ for
2658 `#393 <https://github.com/fmtlib/fmt/pull/393>`_.
Victor Zverovichd30bca62020-07-04 17:43:30 -07002659
26603.0.2 - 2017-06-14
2661------------------
2662
Victor Zverovich372175c2020-07-05 06:06:29 -07002663* Added ``FMT_VERSION`` macro
2664 (`#411 <https://github.com/fmtlib/fmt/issues/411>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002665
Victor Zverovich372175c2020-07-05 06:06:29 -07002666* Used ``FMT_NULL`` instead of literal ``0``
2667 (`#409 <https://github.com/fmtlib/fmt/pull/409>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002668 Thanks `@alabuzhev (Alex Alabuzhev) <https://github.com/alabuzhev>`_.
2669
Victor Zverovich372175c2020-07-05 06:06:29 -07002670* Added extern templates for ``format_float``
2671 (`#413 <https://github.com/fmtlib/fmt/issues/413>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002672
Victor Zverovich372175c2020-07-05 06:06:29 -07002673* Fixed implicit conversion issue
2674 (`#507 <https://github.com/fmtlib/fmt/issues/507>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002675
Victor Zverovich372175c2020-07-05 06:06:29 -07002676* Fixed signbit detection (`#423 <https://github.com/fmtlib/fmt/issues/423>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002677
Victor Zverovich372175c2020-07-05 06:06:29 -07002678* Fixed naming collision (`#425 <https://github.com/fmtlib/fmt/issues/425>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002679
Victor Zverovich372175c2020-07-05 06:06:29 -07002680* Fixed missing intrinsic for C++/CLI
2681 (`#457 <https://github.com/fmtlib/fmt/pull/457>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002682 Thanks `@calumr (Calum Robinson) <https://github.com/calumr>`_
2683
Victor Zverovich372175c2020-07-05 06:06:29 -07002684* Fixed Android detection (`#458 <https://github.com/fmtlib/fmt/pull/458>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002685 Thanks `@Gachapen (Magnus Bjerke Vik) <https://github.com/Gachapen>`_.
2686
Victor Zverovich372175c2020-07-05 06:06:29 -07002687* Use lean ``windows.h`` if not in header-only mode
2688 (`#503 <https://github.com/fmtlib/fmt/pull/503>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002689 Thanks `@Quentin01 (Quentin Buathier) <https://github.com/Quentin01>`_.
2690
Victor Zverovich372175c2020-07-05 06:06:29 -07002691* Fixed issue with CMake exporting C++11 flag
2692 (`#445 <https://github.com/fmtlib/fmt/pull/455>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002693 Thanks `@EricWF (Eric) <https://github.com/EricWF>`_.
2694
Victor Zverovich372175c2020-07-05 06:06:29 -07002695* Fixed issue with nvcc and MSVC compiler bug and MinGW
2696 (`#505 <https://github.com/fmtlib/fmt/issues/505>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002697
Victor Zverovich372175c2020-07-05 06:06:29 -07002698* Fixed DLL issues (`#469 <https://github.com/fmtlib/fmt/pull/469>`_ and
2699 `#502 <https://github.com/fmtlib/fmt/pull/502>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002700 Thanks `@richardeakin (Richard Eakin) <https://github.com/richardeakin>`_ and
2701 `@AndreasSchoenle (Andreas Schönle) <https://github.com/AndreasSchoenle>`_.
2702
Victor Zverovich372175c2020-07-05 06:06:29 -07002703* Fixed test compilation under FreeBSD
2704 (`#433 <https://github.com/fmtlib/fmt/issues/433>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002705
Victor Zverovich372175c2020-07-05 06:06:29 -07002706* Fixed various warnings (`#403 <https://github.com/fmtlib/fmt/pull/403>`_,
2707 `#410 <https://github.com/fmtlib/fmt/pull/410>`_ and
2708 `#510 <https://github.com/fmtlib/fmt/pull/510>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002709 Thanks `@Lecetem <https://github.com/Lectem>`_,
2710 `@chenhayat (Chen Hayat) <https://github.com/chenhayat>`_ and
2711 `@trozen <https://github.com/trozen>`_.
2712
Victor Zverovich372175c2020-07-05 06:06:29 -07002713* Worked around a broken ``__builtin_clz`` in clang with MS codegen
2714 (`#519 <https://github.com/fmtlib/fmt/issues/519>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002715
Victor Zverovich372175c2020-07-05 06:06:29 -07002716* Removed redundant include
2717 (`#479 <https://github.com/fmtlib/fmt/issues/479>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002718
2719* Fixed documentation issues.
2720
27213.0.1 - 2016-11-01
2722------------------
Victor Zverovich372175c2020-07-05 06:06:29 -07002723* Fixed handling of thousands separator
2724 (`#353 <https://github.com/fmtlib/fmt/issues/353>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002725
Victor Zverovich372175c2020-07-05 06:06:29 -07002726* Fixed handling of ``unsigned char`` strings
2727 (`#373 <https://github.com/fmtlib/fmt/issues/373>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002728
Victor Zverovich372175c2020-07-05 06:06:29 -07002729* Corrected buffer growth when formatting time
2730 (`#367 <https://github.com/fmtlib/fmt/issues/367>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002731
Victor Zverovich372175c2020-07-05 06:06:29 -07002732* Removed warnings under MSVC and clang
2733 (`#318 <https://github.com/fmtlib/fmt/issues/318>`_,
2734 `#250 <https://github.com/fmtlib/fmt/issues/250>`_, also merged
2735 `#385 <https://github.com/fmtlib/fmt/pull/385>`_ and
2736 `#361 <https://github.com/fmtlib/fmt/pull/361>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002737 Thanks `@jcelerier (Jean-Michaël Celerier) <https://github.com/jcelerier>`_
2738 and `@nmoehrle (Nils Moehrle) <https://github.com/nmoehrle>`_.
2739
Victor Zverovich372175c2020-07-05 06:06:29 -07002740* Fixed compilation issues under Android
2741 (`#327 <https://github.com/fmtlib/fmt/pull/327>`_,
2742 `#345 <https://github.com/fmtlib/fmt/issues/345>`_ and
2743 `#381 <https://github.com/fmtlib/fmt/pull/381>`_),
2744 FreeBSD (`#358 <https://github.com/fmtlib/fmt/pull/358>`_),
2745 Cygwin (`#388 <https://github.com/fmtlib/fmt/issues/388>`_),
2746 MinGW (`#355 <https://github.com/fmtlib/fmt/issues/355>`_) as well as other
2747 issues (`#350 <https://github.com/fmtlib/fmt/issues/350>`_,
2748 `#366 <https://github.com/fmtlib/fmt/issues/355>`_,
2749 `#348 <https://github.com/fmtlib/fmt/pull/348>`_,
2750 `#402 <https://github.com/fmtlib/fmt/pull/402>`_,
2751 `#405 <https://github.com/fmtlib/fmt/pull/405>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002752 Thanks to `@dpantele (Dmitry) <https://github.com/dpantele>`_,
2753 `@hghwng (Hugh Wang) <https://github.com/hghwng>`_,
2754 `@arvedarved (Tilman Keskinöz) <https://github.com/arvedarved>`_,
2755 `@LogicalKnight (Sean) <https://github.com/LogicalKnight>`_ and
2756 `@JanHellwig (Jan Hellwig) <https://github.com/janhellwig>`_.
2757
2758* Fixed some documentation issues and extended specification
Victor Zverovich372175c2020-07-05 06:06:29 -07002759 (`#320 <https://github.com/fmtlib/fmt/issues/320>`_,
2760 `#333 <https://github.com/fmtlib/fmt/pull/333>`_,
2761 `#347 <https://github.com/fmtlib/fmt/issues/347>`_,
2762 `#362 <https://github.com/fmtlib/fmt/pull/362>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002763 Thanks to `@smellman (Taro Matsuzawa aka. btm)
2764 <https://github.com/smellman>`_.
2765
27663.0.0 - 2016-05-07
2767------------------
2768
2769* The project has been renamed from C++ Format (cppformat) to fmt for
Victor Zverovich372175c2020-07-05 06:06:29 -07002770 consistency with the used namespace and macro prefix
2771 (`#307 <https://github.com/fmtlib/fmt/issues/307>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002772 Library headers are now located in the ``fmt`` directory:
2773
2774 .. code:: c++
2775
2776 #include "fmt/format.h"
2777
2778 Including ``format.h`` from the ``cppformat`` directory is deprecated
2779 but works via a proxy header which will be removed in the next major version.
2780
2781 The documentation is now available at https://fmt.dev.
2782
Victor Zverovich372175c2020-07-05 06:06:29 -07002783* Added support for `strftime <http://en.cppreference.com/w/cpp/chrono/c/strftime>`_-like
2784 `date and time formatting <https://fmt.dev/3.0.0/api.html#date-and-time-formatting>`_
2785 (`#283 <https://github.com/fmtlib/fmt/issues/283>`_):
Victor Zverovichd30bca62020-07-04 17:43:30 -07002786
2787 .. code:: c++
2788
2789 #include "fmt/time.h"
2790
2791 std::time_t t = std::time(nullptr);
2792 // Prints "The date is 2016-04-29." (with the current date)
2793 fmt::print("The date is {:%Y-%m-%d}.", *std::localtime(&t));
2794
Victor Zverovich372175c2020-07-05 06:06:29 -07002795* ``std::ostream`` support including formatting of user-defined types that provide
2796 overloaded ``operator<<`` has been moved to ``fmt/ostream.h``:
Victor Zverovichd30bca62020-07-04 17:43:30 -07002797
2798 .. code:: c++
2799
2800 #include "fmt/ostream.h"
2801
2802 class Date {
2803 int year_, month_, day_;
2804 public:
Victor Zverovich372175c2020-07-05 06:06:29 -07002805 Date(int year, int month, int day) : year_(year), month_(month), day_(day) {}
Victor Zverovichd30bca62020-07-04 17:43:30 -07002806
2807 friend std::ostream &operator<<(std::ostream &os, const Date &d) {
2808 return os << d.year_ << '-' << d.month_ << '-' << d.day_;
2809 }
2810 };
2811
2812 std::string s = fmt::format("The date is {}", Date(2012, 12, 9));
2813 // s == "The date is 2012-12-9"
2814
2815* Added support for `custom argument formatters
Victor Zverovich372175c2020-07-05 06:06:29 -07002816 <https://fmt.dev/3.0.0/api.html#argument-formatters>`_
2817 (`#235 <https://github.com/fmtlib/fmt/issues/235>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002818
2819* Added support for locale-specific integer formatting with the ``n`` specifier
Victor Zverovich372175c2020-07-05 06:06:29 -07002820 (`#305 <https://github.com/fmtlib/fmt/issues/305>`_):
Victor Zverovichd30bca62020-07-04 17:43:30 -07002821
2822 .. code:: c++
2823
2824 std::setlocale(LC_ALL, "en_US.utf8");
2825 fmt::print("cppformat: {:n}\n", 1234567); // prints 1,234,567
2826
2827* Sign is now preserved when formatting an integer with an incorrect ``printf``
Victor Zverovich372175c2020-07-05 06:06:29 -07002828 format specifier (`#265 <https://github.com/fmtlib/fmt/issues/265>`_):
Victor Zverovichd30bca62020-07-04 17:43:30 -07002829
2830 .. code:: c++
2831
2832 fmt::printf("%lld", -42); // prints -42
2833
2834 Note that it would be an undefined behavior in ``std::printf``.
2835
2836* Length modifiers such as ``ll`` are now optional in printf formatting
Victor Zverovich372175c2020-07-05 06:06:29 -07002837 functions and the correct type is determined automatically
2838 (`#255 <https://github.com/fmtlib/fmt/issues/255>`_):
Victor Zverovichd30bca62020-07-04 17:43:30 -07002839
2840 .. code:: c++
2841
2842 fmt::printf("%d", std::numeric_limits<long long>::max());
2843
2844 Note that it would be an undefined behavior in ``std::printf``.
2845
Victor Zverovich372175c2020-07-05 06:06:29 -07002846* Added initial support for custom formatters
2847 (`#231 <https://github.com/fmtlib/fmt/issues/231>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002848
2849* Fixed detection of user-defined literal support on Intel C++ compiler
Victor Zverovich372175c2020-07-05 06:06:29 -07002850 (`#311 <https://github.com/fmtlib/fmt/issues/311>`_,
2851 `#312 <https://github.com/fmtlib/fmt/pull/312>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002852 Thanks to `@dean0x7d (Dean Moldovan) <https://github.com/dean0x7d>`_ and
2853 `@speth (Ray Speth) <https://github.com/speth>`_.
2854
Victor Zverovich372175c2020-07-05 06:06:29 -07002855* Reduced compile time
2856 (`#243 <https://github.com/fmtlib/fmt/pull/243>`_,
2857 `#249 <https://github.com/fmtlib/fmt/pull/249>`_,
2858 `#317 <https://github.com/fmtlib/fmt/issues/317>`_):
Victor Zverovichd30bca62020-07-04 17:43:30 -07002859
2860 .. image:: https://cloud.githubusercontent.com/assets/4831417/11614060/
2861 b9e826d2-9c36-11e5-8666-d4131bf503ef.png
2862
2863 .. image:: https://cloud.githubusercontent.com/assets/4831417/11614080/
2864 6ac903cc-9c37-11e5-8165-26df6efae364.png
2865
2866 Thanks to `@dean0x7d (Dean Moldovan) <https://github.com/dean0x7d>`_.
2867
Victor Zverovich372175c2020-07-05 06:06:29 -07002868* Compile test fixes (`#313 <https://github.com/fmtlib/fmt/pull/313>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002869 Thanks to `@dean0x7d (Dean Moldovan) <https://github.com/dean0x7d>`_.
2870
Victor Zverovich372175c2020-07-05 06:06:29 -07002871* Documentation fixes (`#239 <https://github.com/fmtlib/fmt/pull/239>`_,
2872 `#248 <https://github.com/fmtlib/fmt/issues/248>`_,
2873 `#252 <https://github.com/fmtlib/fmt/issues/252>`_,
2874 `#258 <https://github.com/fmtlib/fmt/pull/258>`_,
2875 `#260 <https://github.com/fmtlib/fmt/issues/260>`_,
2876 `#301 <https://github.com/fmtlib/fmt/issues/301>`_,
2877 `#309 <https://github.com/fmtlib/fmt/pull/309>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002878 Thanks to `@ReadmeCritic <https://github.com/ReadmeCritic>`_
2879 `@Gachapen (Magnus Bjerke Vik) <https://github.com/Gachapen>`_ and
2880 `@jwilk (Jakub Wilk) <https://github.com/jwilk>`_.
2881
Victor Zverovich372175c2020-07-05 06:06:29 -07002882* Fixed compiler and sanitizer warnings
2883 (`#244 <https://github.com/fmtlib/fmt/issues/244>`_,
2884 `#256 <https://github.com/fmtlib/fmt/pull/256>`_,
2885 `#259 <https://github.com/fmtlib/fmt/pull/259>`_,
2886 `#263 <https://github.com/fmtlib/fmt/issues/263>`_,
2887 `#274 <https://github.com/fmtlib/fmt/issues/274>`_,
2888 `#277 <https://github.com/fmtlib/fmt/pull/277>`_,
2889 `#286 <https://github.com/fmtlib/fmt/pull/286>`_,
2890 `#291 <https://github.com/fmtlib/fmt/issues/291>`_,
2891 `#296 <https://github.com/fmtlib/fmt/issues/296>`_,
2892 `#308 <https://github.com/fmtlib/fmt/issues/308>`_)
Victor Zverovichd30bca62020-07-04 17:43:30 -07002893 Thanks to `@mwinterb <https://github.com/mwinterb>`_,
2894 `@pweiskircher (Patrik Weiskircher) <https://github.com/pweiskircher>`_,
2895 `@Naios <https://github.com/Naios>`_.
2896
Victor Zverovich372175c2020-07-05 06:06:29 -07002897* Improved compatibility with Windows Store apps
2898 (`#280 <https://github.com/fmtlib/fmt/issues/280>`_,
2899 `#285 <https://github.com/fmtlib/fmt/pull/285>`_)
Victor Zverovichd30bca62020-07-04 17:43:30 -07002900 Thanks to `@mwinterb <https://github.com/mwinterb>`_.
2901
Victor Zverovich372175c2020-07-05 06:06:29 -07002902* Added tests of compatibility with older C++ standards
2903 (`#273 <https://github.com/fmtlib/fmt/pull/273>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002904 Thanks to `@niosHD <https://github.com/niosHD>`_.
2905
Victor Zverovich372175c2020-07-05 06:06:29 -07002906* Fixed Android build (`#271 <https://github.com/fmtlib/fmt/pull/271>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002907 Thanks to `@newnon <https://github.com/newnon>`_.
2908
2909* Changed ``ArgMap`` to be backed by a vector instead of a map.
Victor Zverovich372175c2020-07-05 06:06:29 -07002910 (`#261 <https://github.com/fmtlib/fmt/issues/261>`_,
2911 `#262 <https://github.com/fmtlib/fmt/pull/262>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002912 Thanks to `@mwinterb <https://github.com/mwinterb>`_.
2913
Victor Zverovich372175c2020-07-05 06:06:29 -07002914* Added ``fprintf`` overload that writes to a ``std::ostream``
2915 (`#251 <https://github.com/fmtlib/fmt/pull/251>`_).
2916 Thanks to `nickhutchinson (Nicholas Hutchinson) <https://github.com/nickhutchinson>`_.
Victor Zverovichd30bca62020-07-04 17:43:30 -07002917
Victor Zverovich372175c2020-07-05 06:06:29 -07002918* Export symbols when building a Windows DLL
2919 (`#245 <https://github.com/fmtlib/fmt/pull/245>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002920 Thanks to `macdems (Maciek Dems) <https://github.com/macdems>`_.
2921
Victor Zverovich372175c2020-07-05 06:06:29 -07002922* Fixed compilation on Cygwin (`#304 <https://github.com/fmtlib/fmt/issues/304>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002923
2924* Implemented a workaround for a bug in Apple LLVM version 4.2 of clang
Victor Zverovich372175c2020-07-05 06:06:29 -07002925 (`#276 <https://github.com/fmtlib/fmt/issues/276>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002926
2927* Implemented a workaround for Google Test bug
Victor Zverovich372175c2020-07-05 06:06:29 -07002928 `#705 <https://github.com/google/googletest/issues/705>`_ on gcc 6
2929 (`#268 <https://github.com/fmtlib/fmt/issues/268>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002930 Thanks to `octoploid <https://github.com/octoploid>`_.
2931
2932* Removed Biicode support because the latter has been discontinued.
2933
29342.1.1 - 2016-04-11
2935------------------
2936
2937* The install location for generated CMake files is now configurable via
Victor Zverovich372175c2020-07-05 06:06:29 -07002938 the ``FMT_CMAKE_DIR`` CMake variable
2939 (`#299 <https://github.com/fmtlib/fmt/pull/299>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002940 Thanks to `@niosHD <https://github.com/niosHD>`_.
2941
Victor Zverovich372175c2020-07-05 06:06:29 -07002942* Documentation fixes (`#252 <https://github.com/fmtlib/fmt/issues/252>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002943
29442.1.0 - 2016-03-21
2945------------------
2946
Victor Zverovich372175c2020-07-05 06:06:29 -07002947* Project layout and build system improvements
2948 (`#267 <https://github.com/fmtlib/fmt/pull/267>`_):
Victor Zverovichd30bca62020-07-04 17:43:30 -07002949
2950 * The code have been moved to the ``cppformat`` directory.
2951 Including ``format.h`` from the top-level directory is deprecated
2952 but works via a proxy header which will be removed in the next
2953 major version.
2954
2955 * C++ Format CMake targets now have proper interface definitions.
2956
2957 * Installed version of the library now supports the header-only
2958 configuration.
2959
2960 * Targets ``doc``, ``install``, and ``test`` are now disabled if C++ Format
2961 is included as a CMake subproject. They can be enabled by setting
2962 ``FMT_DOC``, ``FMT_INSTALL``, and ``FMT_TEST`` in the parent project.
2963
2964 Thanks to `@niosHD <https://github.com/niosHD>`_.
2965
29662.0.1 - 2016-03-13
2967------------------
2968
Victor Zverovich372175c2020-07-05 06:06:29 -07002969* Improved CMake find and package support
2970 (`#264 <https://github.com/fmtlib/fmt/issues/264>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002971 Thanks to `@niosHD <https://github.com/niosHD>`_.
2972
Victor Zverovich372175c2020-07-05 06:06:29 -07002973* Fix compile error with Android NDK and mingw32
2974 (`#241 <https://github.com/fmtlib/fmt/issues/241>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002975 Thanks to `@Gachapen (Magnus Bjerke Vik) <https://github.com/Gachapen>`_.
2976
Victor Zverovich372175c2020-07-05 06:06:29 -07002977* Documentation fixes
2978 (`#248 <https://github.com/fmtlib/fmt/issues/248>`_,
2979 `#260 <https://github.com/fmtlib/fmt/issues/260>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07002980
29812.0.0 - 2015-12-01
2982------------------
2983
2984General
2985~~~~~~~
2986
Victor Zverovich372175c2020-07-05 06:06:29 -07002987* [Breaking] Named arguments
2988 (`#169 <https://github.com/fmtlib/fmt/pull/169>`_,
2989 `#173 <https://github.com/fmtlib/fmt/pull/173>`_,
2990 `#174 <https://github.com/fmtlib/fmt/pull/174>`_):
Victor Zverovichd30bca62020-07-04 17:43:30 -07002991
2992 .. code:: c++
2993
2994 fmt::print("The answer is {answer}.", fmt::arg("answer", 42));
2995
2996 Thanks to `@jamboree <https://github.com/jamboree>`_.
2997
2998* [Experimental] User-defined literals for format and named arguments
Victor Zverovich372175c2020-07-05 06:06:29 -07002999 (`#204 <https://github.com/fmtlib/fmt/pull/204>`_,
3000 `#206 <https://github.com/fmtlib/fmt/pull/206>`_,
3001 `#207 <https://github.com/fmtlib/fmt/pull/207>`_):
Victor Zverovichd30bca62020-07-04 17:43:30 -07003002
3003 .. code:: c++
3004
3005 using namespace fmt::literals;
3006 fmt::print("The answer is {answer}.", "answer"_a=42);
3007
3008 Thanks to `@dean0x7d (Dean Moldovan) <https://github.com/dean0x7d>`_.
3009
3010* [Breaking] Formatting of more than 16 arguments is now supported when using
Victor Zverovich372175c2020-07-05 06:06:29 -07003011 variadic templates
3012 (`#141 <https://github.com/fmtlib/fmt/issues/141>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07003013 Thanks to `@Shauren <https://github.com/Shauren>`_.
3014
Victor Zverovich372175c2020-07-05 06:06:29 -07003015* Runtime width specification
3016 (`#168 <https://github.com/fmtlib/fmt/pull/168>`_):
Victor Zverovichd30bca62020-07-04 17:43:30 -07003017
3018 .. code:: c++
3019
3020 fmt::format("{0:{1}}", 42, 5); // gives " 42"
3021
3022 Thanks to `@jamboree <https://github.com/jamboree>`_.
3023
Victor Zverovich372175c2020-07-05 06:06:29 -07003024* [Breaking] Enums are now formatted with an overloaded ``std::ostream`` insertion
3025 operator (``operator<<``) if available
3026 (`#232 <https://github.com/fmtlib/fmt/issues/232>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07003027
3028* [Breaking] Changed default ``bool`` format to textual, "true" or "false"
Victor Zverovich372175c2020-07-05 06:06:29 -07003029 (`#170 <https://github.com/fmtlib/fmt/issues/170>`_):
Victor Zverovichd30bca62020-07-04 17:43:30 -07003030
3031 .. code:: c++
3032
3033 fmt::print("{}", true); // prints "true"
3034
3035 To print ``bool`` as a number use numeric format specifier such as ``d``:
3036
3037 .. code:: c++
3038
3039 fmt::print("{:d}", true); // prints "1"
3040
Victor Zverovich372175c2020-07-05 06:06:29 -07003041* ``fmt::printf`` and ``fmt::sprintf`` now support formatting of ``bool`` with the
3042 ``%s`` specifier giving textual output, "true" or "false"
3043 (`#223 <https://github.com/fmtlib/fmt/pull/223>`_):
Victor Zverovichd30bca62020-07-04 17:43:30 -07003044
3045 .. code:: c++
3046
3047 fmt::printf("%s", true); // prints "true"
3048
3049 Thanks to `@LarsGullik <https://github.com/LarsGullik>`_.
3050
Victor Zverovich372175c2020-07-05 06:06:29 -07003051* [Breaking] ``signed char`` and ``unsigned char`` are now formatted as integers by default
3052 (`#217 <https://github.com/fmtlib/fmt/pull/217>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07003053
3054* [Breaking] Pointers to C strings can now be formatted with the ``p`` specifier
Victor Zverovich372175c2020-07-05 06:06:29 -07003055 (`#223 <https://github.com/fmtlib/fmt/pull/223>`_):
Victor Zverovichd30bca62020-07-04 17:43:30 -07003056
3057 .. code:: c++
3058
3059 fmt::print("{:p}", "test"); // prints pointer value
3060
3061 Thanks to `@LarsGullik <https://github.com/LarsGullik>`_.
3062
Victor Zverovich372175c2020-07-05 06:06:29 -07003063* [Breaking] ``fmt::printf`` and ``fmt::sprintf`` now print null pointers as ``(nil)``
3064 and null strings as ``(null)`` for consistency with glibc
3065 (`#226 <https://github.com/fmtlib/fmt/pull/226>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07003066 Thanks to `@LarsGullik <https://github.com/LarsGullik>`_.
3067
Victor Zverovich372175c2020-07-05 06:06:29 -07003068* [Breaking] ``fmt::(s)printf`` now supports formatting of objects of user-defined types
3069 that provide an overloaded ``std::ostream`` insertion operator (``operator<<``)
3070 (`#201 <https://github.com/fmtlib/fmt/issues/201>`_):
Victor Zverovichd30bca62020-07-04 17:43:30 -07003071
3072 .. code:: c++
3073
3074 fmt::printf("The date is %s", Date(2012, 12, 9));
3075
Victor Zverovich372175c2020-07-05 06:06:29 -07003076* [Breaking] The ``Buffer`` template is now part of the public API and can be used
3077 to implement custom memory buffers
3078 (`#140 <https://github.com/fmtlib/fmt/issues/140>`_).
3079 Thanks to `@polyvertex (Jean-Charles Lefebvre) <https://github.com/polyvertex>`_.
Victor Zverovichd30bca62020-07-04 17:43:30 -07003080
3081* [Breaking] Improved compatibility between ``BasicStringRef`` and
3082 `std::experimental::basic_string_view
3083 <http://en.cppreference.com/w/cpp/experimental/basic_string_view>`_
Victor Zverovich372175c2020-07-05 06:06:29 -07003084 (`#100 <https://github.com/fmtlib/fmt/issues/100>`_,
3085 `#159 <https://github.com/fmtlib/fmt/issues/159>`_,
3086 `#183 <https://github.com/fmtlib/fmt/issues/183>`_):
Victor Zverovichd30bca62020-07-04 17:43:30 -07003087
3088 - Comparison operators now compare string content, not pointers
3089 - ``BasicStringRef::c_str`` replaced by ``BasicStringRef::data``
3090 - ``BasicStringRef`` is no longer assumed to be null-terminated
3091
3092 References to null-terminated strings are now represented by a new class,
3093 ``BasicCStringRef``.
3094
Victor Zverovich372175c2020-07-05 06:06:29 -07003095* Dependency on pthreads introduced by Google Test is now optional
3096 (`#185 <https://github.com/fmtlib/fmt/issues/185>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07003097
3098* New CMake options ``FMT_DOC``, ``FMT_INSTALL`` and ``FMT_TEST`` to control
Victor Zverovich372175c2020-07-05 06:06:29 -07003099 generation of ``doc``, ``install`` and ``test`` targets respectively, on by default
3100 (`#197 <https://github.com/fmtlib/fmt/issues/197>`_,
3101 `#198 <https://github.com/fmtlib/fmt/issues/198>`_,
3102 `#200 <https://github.com/fmtlib/fmt/issues/200>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07003103 Thanks to `@maddinat0r (Alex Martin) <https://github.com/maddinat0r>`_.
3104
Victor Zverovich372175c2020-07-05 06:06:29 -07003105* ``noexcept`` is now used when compiling with MSVC2015
3106 (`#215 <https://github.com/fmtlib/fmt/pull/215>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07003107 Thanks to `@dmkrepo (Dmitriy) <https://github.com/dmkrepo>`_.
3108
3109* Added an option to disable use of ``windows.h`` when ``FMT_USE_WINDOWS_H``
Victor Zverovich372175c2020-07-05 06:06:29 -07003110 is defined as 0 before including ``format.h``
3111 (`#171 <https://github.com/fmtlib/fmt/issues/171>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07003112 Thanks to `@alfps (Alf P. Steinbach) <https://github.com/alfps>`_.
3113
3114* [Breaking] ``windows.h`` is now included with ``NOMINMAX`` unless
3115 ``FMT_WIN_MINMAX`` is defined. This is done to prevent breaking code using
3116 ``std::min`` and ``std::max`` and only affects the header-only configuration
Victor Zverovich372175c2020-07-05 06:06:29 -07003117 (`#152 <https://github.com/fmtlib/fmt/issues/152>`_,
3118 `#153 <https://github.com/fmtlib/fmt/pull/153>`_,
3119 `#154 <https://github.com/fmtlib/fmt/pull/154>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07003120 Thanks to `@DevO2012 <https://github.com/DevO2012>`_.
3121
Victor Zverovich372175c2020-07-05 06:06:29 -07003122* Improved support for custom character types
3123 (`#171 <https://github.com/fmtlib/fmt/issues/171>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07003124 Thanks to `@alfps (Alf P. Steinbach) <https://github.com/alfps>`_.
3125
3126* Added an option to disable use of IOStreams when ``FMT_USE_IOSTREAMS``
Victor Zverovich372175c2020-07-05 06:06:29 -07003127 is defined as 0 before including ``format.h``
3128 (`#205 <https://github.com/fmtlib/fmt/issues/205>`_,
3129 `#208 <https://github.com/fmtlib/fmt/pull/208>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07003130 Thanks to `@JodiTheTigger <https://github.com/JodiTheTigger>`_.
3131
3132* Improved detection of ``isnan``, ``isinf`` and ``signbit``.
3133
3134Optimization
3135~~~~~~~~~~~~
3136
Victor Zverovich372175c2020-07-05 06:06:29 -07003137* Made formatting of user-defined types more efficient with a custom stream buffer
3138 (`#92 <https://github.com/fmtlib/fmt/issues/92>`_,
3139 `#230 <https://github.com/fmtlib/fmt/pull/230>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07003140 Thanks to `@NotImplemented <https://github.com/NotImplemented>`_.
3141
3142* Further improved performance of ``fmt::Writer`` on integer formatting
3143 and fixed a minor regression. Now it is ~7% faster than ``karma::generate``
Victor Zverovich372175c2020-07-05 06:06:29 -07003144 on Karma's benchmark
3145 (`#186 <https://github.com/fmtlib/fmt/issues/186>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07003146
3147* [Breaking] Reduced `compiled code size
3148 <https://github.com/fmtlib/fmt#compile-time-and-code-bloat>`_
Victor Zverovich372175c2020-07-05 06:06:29 -07003149 (`#143 <https://github.com/fmtlib/fmt/issues/143>`_,
3150 `#149 <https://github.com/fmtlib/fmt/pull/149>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07003151
3152Distribution
3153~~~~~~~~~~~~
3154
3155* [Breaking] Headers are now installed in
Victor Zverovich372175c2020-07-05 06:06:29 -07003156 ``${CMAKE_INSTALL_PREFIX}/include/cppformat``
3157 (`#178 <https://github.com/fmtlib/fmt/issues/178>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07003158 Thanks to `@jackyf (Eugene V. Lyubimkin) <https://github.com/jackyf>`_.
3159
3160* [Breaking] Changed the library name from ``format`` to ``cppformat``
3161 for consistency with the project name and to avoid potential conflicts
Victor Zverovich372175c2020-07-05 06:06:29 -07003162 (`#178 <https://github.com/fmtlib/fmt/issues/178>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07003163 Thanks to `@jackyf (Eugene V. Lyubimkin) <https://github.com/jackyf>`_.
3164
3165* C++ Format is now available in `Debian <https://www.debian.org/>`_ GNU/Linux
3166 (`stretch <https://packages.debian.org/source/stretch/cppformat>`_,
3167 `sid <https://packages.debian.org/source/sid/cppformat>`_) and
3168 derived distributions such as
3169 `Ubuntu <https://launchpad.net/ubuntu/+source/cppformat>`_ 15.10 and later
Victor Zverovich372175c2020-07-05 06:06:29 -07003170 (`#155 <https://github.com/fmtlib/fmt/issues/155>`_)::
Victor Zverovichd30bca62020-07-04 17:43:30 -07003171
3172 $ sudo apt-get install libcppformat1-dev
3173
3174 Thanks to `@jackyf (Eugene V. Lyubimkin) <https://github.com/jackyf>`_.
3175
Victor Zverovich372175c2020-07-05 06:06:29 -07003176* `Packages for Fedora and RHEL <https://admin.fedoraproject.org/pkgdb/package/cppformat/>`_
3177 are now available. Thanks to Dave Johansen.
Victor Zverovichd30bca62020-07-04 17:43:30 -07003178
3179* C++ Format can now be installed via `Homebrew <http://brew.sh/>`_ on OS X
Victor Zverovich372175c2020-07-05 06:06:29 -07003180 (`#157 <https://github.com/fmtlib/fmt/issues/157>`_)::
Victor Zverovichd30bca62020-07-04 17:43:30 -07003181
3182 $ brew install cppformat
3183
3184 Thanks to `@ortho <https://github.com/ortho>`_, Anatoliy Bulukin.
3185
3186Documentation
3187~~~~~~~~~~~~~
3188
3189* Migrated from ReadTheDocs to GitHub Pages for better responsiveness
Victor Zverovich372175c2020-07-05 06:06:29 -07003190 and reliability
3191 (`#128 <https://github.com/fmtlib/fmt/issues/128>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07003192 New documentation address is http://cppformat.github.io/.
3193
3194
3195* Added `Building the documentation
3196 <https://fmt.dev/2.0.0/usage.html#building-the-documentation>`_
3197 section to the documentation.
3198
Victor Zverovich372175c2020-07-05 06:06:29 -07003199* Documentation build script is now compatible with Python 3 and newer pip versions.
3200 (`#189 <https://github.com/fmtlib/fmt/pull/189>`_,
3201 `#209 <https://github.com/fmtlib/fmt/issues/209>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07003202 Thanks to `@JodiTheTigger <https://github.com/JodiTheTigger>`_ and
3203 `@xentec <https://github.com/xentec>`_.
3204
3205* Documentation fixes and improvements
Victor Zverovich372175c2020-07-05 06:06:29 -07003206 (`#36 <https://github.com/fmtlib/fmt/issues/36>`_,
3207 `#75 <https://github.com/fmtlib/fmt/issues/75>`_,
3208 `#125 <https://github.com/fmtlib/fmt/issues/125>`_,
3209 `#160 <https://github.com/fmtlib/fmt/pull/160>`_,
3210 `#161 <https://github.com/fmtlib/fmt/pull/161>`_,
3211 `#162 <https://github.com/fmtlib/fmt/issues/162>`_,
3212 `#165 <https://github.com/fmtlib/fmt/issues/165>`_,
3213 `#210 <https://github.com/fmtlib/fmt/issues/210>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07003214 Thanks to `@syohex (Syohei YOSHIDA) <https://github.com/syohex>`_ and
3215 bug reporters.
3216
Victor Zverovich372175c2020-07-05 06:06:29 -07003217* Fixed out-of-tree documentation build
3218 (`#177 <https://github.com/fmtlib/fmt/issues/177>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07003219 Thanks to `@jackyf (Eugene V. Lyubimkin) <https://github.com/jackyf>`_.
3220
3221Fixes
3222~~~~~
3223
Victor Zverovich372175c2020-07-05 06:06:29 -07003224* Fixed ``initializer_list`` detection
3225 (`#136 <https://github.com/fmtlib/fmt/issues/136>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07003226 Thanks to `@Gachapen (Magnus Bjerke Vik) <https://github.com/Gachapen>`_.
3227
3228* [Breaking] Fixed formatting of enums with numeric format specifiers in
Victor Zverovich372175c2020-07-05 06:06:29 -07003229 ``fmt::(s)printf``
3230 (`#131 <https://github.com/fmtlib/fmt/issues/131>`_,
3231 `#139 <https://github.com/fmtlib/fmt/issues/139>`_):
Victor Zverovichd30bca62020-07-04 17:43:30 -07003232
3233 .. code:: c++
3234
3235 enum { ANSWER = 42 };
3236 fmt::printf("%d", ANSWER);
3237
3238 Thanks to `@Naios <https://github.com/Naios>`_.
3239
3240* Improved compatibility with old versions of MinGW
Victor Zverovich372175c2020-07-05 06:06:29 -07003241 (`#129 <https://github.com/fmtlib/fmt/issues/129>`_,
3242 `#130 <https://github.com/fmtlib/fmt/pull/130>`_,
3243 `#132 <https://github.com/fmtlib/fmt/issues/132>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07003244 Thanks to `@cstamford (Christopher Stamford) <https://github.com/cstamford>`_.
3245
Victor Zverovich372175c2020-07-05 06:06:29 -07003246* Fixed a compile error on MSVC with disabled exceptions
3247 (`#144 <https://github.com/fmtlib/fmt/issues/144>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07003248
3249* Added a workaround for broken implementation of variadic templates in MSVC2012
Victor Zverovich372175c2020-07-05 06:06:29 -07003250 (`#148 <https://github.com/fmtlib/fmt/issues/148>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07003251
3252* Placed the anonymous namespace within ``fmt`` namespace for the header-only
Victor Zverovich372175c2020-07-05 06:06:29 -07003253 configuration
3254 (`#171 <https://github.com/fmtlib/fmt/issues/171>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07003255 Thanks to `@alfps (Alf P. Steinbach) <https://github.com/alfps>`_.
3256
Victor Zverovich372175c2020-07-05 06:06:29 -07003257* Fixed issues reported by Coverity Scan
3258 (`#187 <https://github.com/fmtlib/fmt/issues/187>`_,
3259 `#192 <https://github.com/fmtlib/fmt/issues/192>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07003260
Victor Zverovich372175c2020-07-05 06:06:29 -07003261* Implemented a workaround for a name lookup bug in MSVC2010
3262 (`#188 <https://github.com/fmtlib/fmt/issues/188>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07003263
Victor Zverovich372175c2020-07-05 06:06:29 -07003264* Fixed compiler warnings
3265 (`#95 <https://github.com/fmtlib/fmt/issues/95>`_,
3266 `#96 <https://github.com/fmtlib/fmt/issues/96>`_,
3267 `#114 <https://github.com/fmtlib/fmt/pull/114>`_,
3268 `#135 <https://github.com/fmtlib/fmt/issues/135>`_,
3269 `#142 <https://github.com/fmtlib/fmt/issues/142>`_,
3270 `#145 <https://github.com/fmtlib/fmt/issues/145>`_,
3271 `#146 <https://github.com/fmtlib/fmt/issues/146>`_,
3272 `#158 <https://github.com/fmtlib/fmt/issues/158>`_,
3273 `#163 <https://github.com/fmtlib/fmt/issues/163>`_,
3274 `#175 <https://github.com/fmtlib/fmt/issues/175>`_,
3275 `#190 <https://github.com/fmtlib/fmt/issues/190>`_,
3276 `#191 <https://github.com/fmtlib/fmt/pull/191>`_,
3277 `#194 <https://github.com/fmtlib/fmt/issues/194>`_,
3278 `#196 <https://github.com/fmtlib/fmt/pull/196>`_,
3279 `#216 <https://github.com/fmtlib/fmt/issues/216>`_,
3280 `#218 <https://github.com/fmtlib/fmt/pull/218>`_,
3281 `#220 <https://github.com/fmtlib/fmt/pull/220>`_,
3282 `#229 <https://github.com/fmtlib/fmt/pull/229>`_,
3283 `#233 <https://github.com/fmtlib/fmt/issues/233>`_,
3284 `#234 <https://github.com/fmtlib/fmt/issues/234>`_,
3285 `#236 <https://github.com/fmtlib/fmt/pull/236>`_,
3286 `#281 <https://github.com/fmtlib/fmt/issues/281>`_,
3287 `#289 <https://github.com/fmtlib/fmt/issues/289>`_).
3288 Thanks to `@seanmiddleditch (Sean Middleditch) <https://github.com/seanmiddleditch>`_,
Victor Zverovichd30bca62020-07-04 17:43:30 -07003289 `@dixlorenz (Dix Lorenz) <https://github.com/dixlorenz>`_,
3290 `@CarterLi (李通æŽČ) <https://github.com/CarterLi>`_,
3291 `@Naios <https://github.com/Naios>`_,
3292 `@fmatthew5876 (Matthew Fioravante) <https://github.com/fmatthew5876>`_,
3293 `@LevskiWeng (Levski Weng) <https://github.com/LevskiWeng>`_,
3294 `@rpopescu <https://github.com/rpopescu>`_,
3295 `@gabime (Gabi Melman) <https://github.com/gabime>`_,
3296 `@cubicool (Jeremy Moles) <https://github.com/cubicool>`_,
3297 `@jkflying (Julian Kent) <https://github.com/jkflying>`_,
3298 `@LogicalKnight (Sean L) <https://github.com/LogicalKnight>`_,
3299 `@inguin (Ingo van Lil) <https://github.com/inguin>`_ and
3300 `@Jopie64 (Johan) <https://github.com/Jopie64>`_.
3301
Victor Zverovich372175c2020-07-05 06:06:29 -07003302* Fixed portability issues (mostly causing test failures) on ARM, ppc64, ppc64le,
3303 s390x and SunOS 5.11 i386
3304 (`#138 <https://github.com/fmtlib/fmt/issues/138>`_,
3305 `#179 <https://github.com/fmtlib/fmt/issues/179>`_,
3306 `#180 <https://github.com/fmtlib/fmt/issues/180>`_,
3307 `#202 <https://github.com/fmtlib/fmt/issues/202>`_,
3308 `#225 <https://github.com/fmtlib/fmt/issues/225>`_,
3309 `Red Hat Bugzilla Bug 1260297 <https://bugzilla.redhat.com/show_bug.cgi?id=1260297>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07003310 Thanks to `@Naios <https://github.com/Naios>`_,
Victor Zverovich372175c2020-07-05 06:06:29 -07003311 `@jackyf (Eugene V. Lyubimkin) <https://github.com/jackyf>`_ and Dave Johansen.
Victor Zverovichd30bca62020-07-04 17:43:30 -07003312
Victor Zverovich372175c2020-07-05 06:06:29 -07003313* Fixed a name conflict with macro ``free`` defined in
3314 ``crtdbg.h`` when ``_CRTDBG_MAP_ALLOC`` is set
3315 (`#211 <https://github.com/fmtlib/fmt/issues/211>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07003316
Victor Zverovich372175c2020-07-05 06:06:29 -07003317* Fixed shared library build on OS X
3318 (`#212 <https://github.com/fmtlib/fmt/pull/212>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07003319 Thanks to `@dean0x7d (Dean Moldovan) <https://github.com/dean0x7d>`_.
3320
3321* Fixed an overload conflict on MSVC when ``/Zc:wchar_t-`` option is specified
Victor Zverovich372175c2020-07-05 06:06:29 -07003322 (`#214 <https://github.com/fmtlib/fmt/pull/214>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07003323 Thanks to `@slavanap (Vyacheslav Napadovsky) <https://github.com/slavanap>`_.
3324
Victor Zverovich372175c2020-07-05 06:06:29 -07003325* Improved compatibility with MSVC 2008
3326 (`#236 <https://github.com/fmtlib/fmt/pull/236>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07003327 Thanks to `@Jopie64 (Johan) <https://github.com/Jopie64>`_.
3328
Victor Zverovich372175c2020-07-05 06:06:29 -07003329* Improved compatibility with bcc32
3330 (`#227 <https://github.com/fmtlib/fmt/issues/227>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07003331
Victor Zverovich372175c2020-07-05 06:06:29 -07003332* Fixed ``static_assert`` detection on Clang
3333 (`#228 <https://github.com/fmtlib/fmt/pull/228>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07003334 Thanks to `@dean0x7d (Dean Moldovan) <https://github.com/dean0x7d>`_.
3335
33361.1.0 - 2015-03-06
3337------------------
3338
3339* Added ``BasicArrayWriter``, a class template that provides operations for
3340 formatting and writing data into a fixed-size array
Victor Zverovich372175c2020-07-05 06:06:29 -07003341 (`#105 <https://github.com/fmtlib/fmt/issues/105>`_ and
3342 `#122 <https://github.com/fmtlib/fmt/issues/122>`_):
Victor Zverovichd30bca62020-07-04 17:43:30 -07003343
3344 .. code:: c++
3345
3346 char buffer[100];
3347 fmt::ArrayWriter w(buffer);
3348 w.write("The answer is {}", 42);
3349
3350* Added `0 A.D. <http://play0ad.com/>`_ and `PenUltima Online (POL)
3351 <http://www.polserver.com/>`_ to the list of notable projects using C++ Format.
3352
3353* C++ Format now uses MSVC intrinsics for better formatting performance
Victor Zverovich372175c2020-07-05 06:06:29 -07003354 (`#115 <https://github.com/fmtlib/fmt/pull/115>`_,
3355 `#116 <https://github.com/fmtlib/fmt/pull/116>`_,
3356 `#118 <https://github.com/fmtlib/fmt/pull/118>`_ and
3357 `#121 <https://github.com/fmtlib/fmt/pull/121>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07003358 Previously these optimizations where only used on GCC and Clang.
3359 Thanks to `@CarterLi <https://github.com/CarterLi>`_ and
3360 `@objectx <https://github.com/objectx>`_.
3361
Victor Zverovich372175c2020-07-05 06:06:29 -07003362* CMake install target (`#119 <https://github.com/fmtlib/fmt/pull/119>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07003363 Thanks to `@TrentHouliston <https://github.com/TrentHouliston>`_.
3364
3365 You can now install C++ Format with ``make install`` command.
3366
3367* Improved `Biicode <http://www.biicode.com/>`_ support
Victor Zverovich372175c2020-07-05 06:06:29 -07003368 (`#98 <https://github.com/fmtlib/fmt/pull/98>`_ and
3369 `#104 <https://github.com/fmtlib/fmt/pull/104>`_). Thanks to
Victor Zverovichd30bca62020-07-04 17:43:30 -07003370 `@MariadeAnton <https://github.com/MariadeAnton>`_ and
3371 `@franramirez688 <https://github.com/franramirez688>`_.
3372
3373* Improved support for building with `Android NDK
Victor Zverovich372175c2020-07-05 06:06:29 -07003374 <https://developer.android.com/tools/sdk/ndk/index.html>`_
3375 (`#107 <https://github.com/fmtlib/fmt/pull/107>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07003376 Thanks to `@newnon <https://github.com/newnon>`_.
3377
3378 The `android-ndk-example <https://github.com/fmtlib/android-ndk-example>`_
3379 repository provides and example of using C++ Format with Android NDK:
3380
3381 .. image:: https://raw.githubusercontent.com/fmtlib/android-ndk-example/
3382 master/screenshot.png
3383
Victor Zverovich372175c2020-07-05 06:06:29 -07003384* Improved documentation of ``SystemError`` and ``WindowsError``
3385 (`#54 <https://github.com/fmtlib/fmt/issues/54>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07003386
Victor Zverovich372175c2020-07-05 06:06:29 -07003387* Various code improvements
3388 (`#110 <https://github.com/fmtlib/fmt/pull/110>`_,
3389 `#111 <https://github.com/fmtlib/fmt/pull/111>`_
3390 `#112 <https://github.com/fmtlib/fmt/pull/112>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07003391 Thanks to `@CarterLi <https://github.com/CarterLi>`_.
3392
3393* Improved compile-time errors when formatting wide into narrow strings
Victor Zverovich372175c2020-07-05 06:06:29 -07003394 (`#117 <https://github.com/fmtlib/fmt/issues/117>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07003395
3396* Fixed ``BasicWriter::write`` without formatting arguments when C++11 support
Victor Zverovich372175c2020-07-05 06:06:29 -07003397 is disabled (`#109 <https://github.com/fmtlib/fmt/issues/109>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07003398
Victor Zverovich372175c2020-07-05 06:06:29 -07003399* Fixed header-only build on OS X with GCC 4.9
3400 (`#124 <https://github.com/fmtlib/fmt/issues/124>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07003401
Victor Zverovich372175c2020-07-05 06:06:29 -07003402* Fixed packaging issues (`#94 <https://github.com/fmtlib/fmt/issues/94>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07003403
3404* Added `changelog <https://github.com/fmtlib/fmt/blob/master/ChangeLog.rst>`_
Victor Zverovich372175c2020-07-05 06:06:29 -07003405 (`#103 <https://github.com/fmtlib/fmt/issues/103>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07003406
34071.0.0 - 2015-02-05
3408------------------
3409
3410* Add support for a header-only configuration when ``FMT_HEADER_ONLY`` is
3411 defined before including ``format.h``:
3412
3413 .. code:: c++
3414
3415 #define FMT_HEADER_ONLY
3416 #include "format.h"
3417
3418* Compute string length in the constructor of ``BasicStringRef``
3419 instead of the ``size`` method
Victor Zverovich372175c2020-07-05 06:06:29 -07003420 (`#79 <https://github.com/fmtlib/fmt/issues/79>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07003421 This eliminates size computation for string literals on reasonable optimizing
3422 compilers.
3423
3424* Fix formatting of types with overloaded ``operator <<`` for ``std::wostream``
Victor Zverovich372175c2020-07-05 06:06:29 -07003425 (`#86 <https://github.com/fmtlib/fmt/issues/86>`_):
Victor Zverovichd30bca62020-07-04 17:43:30 -07003426
3427 .. code:: c++
3428
3429 fmt::format(L"The date is {0}", Date(2012, 12, 9));
3430
Victor Zverovich372175c2020-07-05 06:06:29 -07003431* Fix linkage of tests on Arch Linux
3432 (`#89 <https://github.com/fmtlib/fmt/issues/89>`_).
Victor Zverovichd30bca62020-07-04 17:43:30 -07003433
Victor Zverovich372175c2020-07-05 06:06:29 -07003434* Allow precision specifier for non-float arguments
3435 (`#90 <https://github.com/fmtlib/fmt/issues/90>`_):
Victor Zverovichd30bca62020-07-04 17:43:30 -07003436
3437 .. code:: c++
3438
3439 fmt::print("{:.3}\n", "Carpet"); // prints "Car"
3440
Victor Zverovich372175c2020-07-05 06:06:29 -07003441* Fix build on Android NDK
3442 (`#93 <https://github.com/fmtlib/fmt/issues/93>`_)
Victor Zverovichd30bca62020-07-04 17:43:30 -07003443
3444* Improvements to documentation build procedure.
3445
3446* Remove ``FMT_SHARED`` CMake variable in favor of standard `BUILD_SHARED_LIBS
3447 <http://www.cmake.org/cmake/help/v3.0/variable/BUILD_SHARED_LIBS.html>`_.
3448
3449* Fix error handling in ``fmt::fprintf``.
3450
3451* Fix a number of warnings.
3452
34530.12.0 - 2014-10-25
3454-------------------
3455
3456* [Breaking] Improved separation between formatting and buffer management.
3457 ``Writer`` is now a base class that cannot be instantiated directly.
3458 The new ``MemoryWriter`` class implements the default buffer management
3459 with small allocations done on stack. So ``fmt::Writer`` should be replaced
3460 with ``fmt::MemoryWriter`` in variable declarations.
3461
3462 Old code:
3463
3464 .. code:: c++
3465
3466 fmt::Writer w;
3467
3468 New code:
3469
3470 .. code:: c++
3471
3472 fmt::MemoryWriter w;
3473
3474 If you pass ``fmt::Writer`` by reference, you can continue to do so:
3475
3476 .. code:: c++
3477
3478 void f(fmt::Writer &w);
3479
3480 This doesn't affect the formatting API.
3481
Victor Zverovich372175c2020-07-05 06:06:29 -07003482* Support for custom memory allocators
3483 (`#69 <https://github.com/fmtlib/fmt/issues/69>`_)
Victor Zverovichd30bca62020-07-04 17:43:30 -07003484
3485* Formatting functions now accept `signed char` and `unsigned char` strings as
Victor Zverovich372175c2020-07-05 06:06:29 -07003486 arguments (`#73 <https://github.com/fmtlib/fmt/issues/73>`_):
Victor Zverovichd30bca62020-07-04 17:43:30 -07003487
3488 .. code:: c++
3489
3490 auto s = format("GLSL version: {}", glGetString(GL_VERSION));
3491
3492* Reduced code bloat. According to the new `benchmark results
3493 <https://github.com/fmtlib/fmt#compile-time-and-code-bloat>`_,
3494 cppformat is close to ``printf`` and by the order of magnitude better than
3495 Boost Format in terms of compiled code size.
3496
3497* Improved appearance of the documentation on mobile by using the `Sphinx
3498 Bootstrap theme <http://ryan-roemer.github.io/sphinx-bootstrap-theme/>`_:
3499
3500 .. |old| image:: https://cloud.githubusercontent.com/assets/576385/4792130/
3501 cd256436-5de3-11e4-9a62-c077d0c2b003.png
3502
3503 .. |new| image:: https://cloud.githubusercontent.com/assets/576385/4792131/
3504 cd29896c-5de3-11e4-8f59-cac952942bf0.png
3505
3506 +-------+-------+
3507 | Old | New |
3508 +-------+-------+
3509 | |old| | |new| |
3510 +-------+-------+
3511
35120.11.0 - 2014-08-21
3513-------------------
3514
3515* Safe printf implementation with a POSIX extension for positional arguments:
3516
3517 .. code:: c++
3518
3519 fmt::printf("Elapsed time: %.2f seconds", 1.23);
3520 fmt::printf("%1$s, %3$d %2$s", weekday, month, day);
3521
Victor Zverovich372175c2020-07-05 06:06:29 -07003522* Arguments of ``char`` type can now be formatted as integers
3523 (Issue `#55 <https://github.com/fmtlib/fmt/issues/55>`_):
Victor Zverovichd30bca62020-07-04 17:43:30 -07003524
3525 .. code:: c++
3526
3527 fmt::format("0x{0:02X}", 'a');
3528
3529* Deprecated parts of the API removed.
3530
3531* The library is now built and tested on MinGW with Appveyor in addition to
3532 existing test platforms Linux/GCC, OS X/Clang, Windows/MSVC.
3533
35340.10.0 - 2014-07-01
3535-------------------
3536
3537**Improved API**
3538
3539* All formatting methods are now implemented as variadic functions instead
3540 of using ``operator<<`` for feeding arbitrary arguments into a temporary
3541 formatter object. This works both with C++11 where variadic templates are
3542 used and with older standards where variadic functions are emulated by
3543 providing lightweight wrapper functions defined with the ``FMT_VARIADIC``
3544 macro. You can use this macro for defining your own portable variadic
3545 functions:
3546
3547 .. code:: c++
3548
3549 void report_error(const char *format, const fmt::ArgList &args) {
3550 fmt::print("Error: {}");
3551 fmt::print(format, args);
3552 }
3553 FMT_VARIADIC(void, report_error, const char *)
3554
3555 report_error("file not found: {}", path);
3556
3557 Apart from a more natural syntax, this also improves performance as there
3558 is no need to construct temporary formatter objects and control arguments'
3559 lifetimes. Because the wrapper functions are very lightweight, this doesn't
3560 cause code bloat even in pre-C++11 mode.
3561
3562* Simplified common case of formatting an ``std::string``. Now it requires a
3563 single function call:
3564
3565 .. code:: c++
3566
3567 std::string s = format("The answer is {}.", 42);
3568
3569 Previously it required 2 function calls:
3570
3571 .. code:: c++
3572
3573 std::string s = str(Format("The answer is {}.") << 42);
3574
3575 Instead of unsafe ``c_str`` function, ``fmt::Writer`` should be used directly
3576 to bypass creation of ``std::string``:
3577
3578 .. code:: c++
3579
3580 fmt::Writer w;
3581 w.write("The answer is {}.", 42);
3582 w.c_str(); // returns a C string
3583
3584 This doesn't do dynamic memory allocation for small strings and is less error
3585 prone as the lifetime of the string is the same as for ``std::string::c_str``
3586 which is well understood (hopefully).
3587
3588* Improved consistency in naming functions that are a part of the public API.
3589 Now all public functions are lowercase following the standard library
3590 conventions. Previously it was a combination of lowercase and
3591 CapitalizedWords.
Victor Zverovich372175c2020-07-05 06:06:29 -07003592 Issue `#50 <https://github.com/fmtlib/fmt/issues/50>`_.
Victor Zverovichd30bca62020-07-04 17:43:30 -07003593
3594* Old functions are marked as deprecated and will be removed in the next
3595 release.
3596
3597**Other Changes**
3598
3599* Experimental support for printf format specifications (work in progress):
3600
3601 .. code:: c++
3602
3603 fmt::printf("The answer is %d.", 42);
3604 std::string s = fmt::sprintf("Look, a %s!", "string");
3605
3606* Support for hexadecimal floating point format specifiers ``a`` and ``A``:
3607
3608 .. code:: c++
3609
3610 print("{:a}", -42.0); // Prints -0x1.5p+5
3611 print("{:A}", -42.0); // Prints -0X1.5P+5
3612
3613* CMake option ``FMT_SHARED`` that specifies whether to build format as a
3614 shared library (off by default).
3615
36160.9.0 - 2014-05-13
3617------------------
3618
3619* More efficient implementation of variadic formatting functions.
3620
3621* ``Writer::Format`` now has a variadic overload:
3622
3623 .. code:: c++
3624
3625 Writer out;
3626 out.Format("Look, I'm {}!", "variadic");
3627
3628* For efficiency and consistency with other overloads, variadic overload of
3629 the ``Format`` function now returns ``Writer`` instead of ``std::string``.
3630 Use the ``str`` function to convert it to ``std::string``:
3631
3632 .. code:: c++
3633
3634 std::string s = str(Format("Look, I'm {}!", "variadic"));
3635
3636* Replaced formatter actions with output sinks: ``NoAction`` -> ``NullSink``,
3637 ``Write`` -> ``FileSink``, ``ColorWriter`` -> ``ANSITerminalSink``.
3638 This improves naming consistency and shouldn't affect client code unless
3639 these classes are used directly which should be rarely needed.
3640
3641* Added ``ThrowSystemError`` function that formats a message and throws
3642 ``SystemError`` containing the formatted message and system-specific error
3643 description. For example, the following code
3644
3645 .. code:: c++
3646
3647 FILE *f = fopen(filename, "r");
3648 if (!f)
3649 ThrowSystemError(errno, "Failed to open file '{}'") << filename;
3650
3651 will throw ``SystemError`` exception with description
3652 "Failed to open file '<filename>': No such file or directory" if file
3653 doesn't exist.
3654
3655* Support for AppVeyor continuous integration platform.
3656
3657* ``Format`` now throws ``SystemError`` in case of I/O errors.
3658
3659* Improve test infrastructure. Print functions are now tested by redirecting
3660 the output to a pipe.
3661
36620.8.0 - 2014-04-14
3663------------------
3664
Victor Zverovich372175c2020-07-05 06:06:29 -07003665* Initial release