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