Victor Zverovich | 7bdf062 | 2020-11-24 17:15:02 -0800 | [diff] [blame] | 1 | 7.1.3 - 2020-11-24 |
| 2 | ------------------ |
Victor Zverovich | a2fa5d6 | 2020-11-23 10:35:07 -0800 | [diff] [blame] | 3 | |
Victor Zverovich | 6ce207b | 2020-11-24 08:29:17 -0800 | [diff] [blame] | 4 | * Fixed handling of buffer boundaries in ``format_to_n`` |
Victor Zverovich | 07b1c1a | 2020-11-24 08:24:14 -0800 | [diff] [blame] | 5 | (`#1996 <https://github.com/fmtlib/fmt/issues/1996>`_, |
| 6 | `#2029 <https://github.com/fmtlib/fmt/issues/2029>`_). |
Victor Zverovich | a2fa5d6 | 2020-11-23 10:35:07 -0800 | [diff] [blame] | 7 | |
| 8 | * Fixed linkage errors when linking with a shared library |
| 9 | (`#2011 <https://github.com/fmtlib/fmt/issues/2011>`_). |
| 10 | |
Victor Zverovich | fc13551 | 2020-11-24 17:14:00 -0800 | [diff] [blame] | 11 | * Reintroduced ostream support to range formatters |
Victor Zverovich | 07b1c1a | 2020-11-24 08:24:14 -0800 | [diff] [blame] | 12 | (`#2014 <https://github.com/fmtlib/fmt/issues/2014>`_). |
| 13 | |
Victor Zverovich | fc13551 | 2020-11-24 17:14:00 -0800 | [diff] [blame] | 14 | * Worked around an issue with mixing std versions in gcc |
Victor Zverovich | 07b1c1a | 2020-11-24 08:24:14 -0800 | [diff] [blame] | 15 | (`#2017 <https://github.com/fmtlib/fmt/issues/2017>`_). |
| 16 | |
Victor Zverovich | cc09f1a | 2020-11-04 06:50:09 -0800 | [diff] [blame] | 17 | 7.1.2 - 2020-11-04 |
| 18 | ------------------ |
Victor Zverovich | e4eb242 | 2020-11-03 21:20:53 -0800 | [diff] [blame] | 19 | |
| 20 | * Fixed floating point formatting with large precision |
| 21 | (`#1976 <https://github.com/fmtlib/fmt/issues/1976>`_). |
| 22 | |
Victor Zverovich | 5f7f7b9 | 2020-11-01 06:30:39 -0800 | [diff] [blame] | 23 | 7.1.1 - 2020-11-01 |
| 24 | ------------------ |
Victor Zverovich | 5d3f074 | 2020-11-01 06:21:00 -0800 | [diff] [blame] | 25 | |
| 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 Zverovich | 4fe0b11 | 2020-10-25 10:44:22 -0700 | [diff] [blame] | 47 | 7.1.0 - 2020-10-25 |
| 48 | ------------------ |
Victor Zverovich | da8278e | 2020-10-19 14:37:14 -0700 | [diff] [blame] | 49 | |
Victor Zverovich | 62c7205 | 2020-10-25 08:56:46 -0700 | [diff] [blame] | 50 | * 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 Zverovich | 740385d | 2020-10-24 11:18:33 -0700 | [diff] [blame] | 55 | (`#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 Zverovich | 62c7205 | 2020-10-25 08:56:46 -0700 | [diff] [blame] | 60 | and faster than double-conversion and Ryƫ: |
Victor Zverovich | 740385d | 2020-10-24 11:18:33 -0700 | [diff] [blame] | 61 | |
| 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 Zverovich | 62c7205 | 2020-10-25 08:56:46 -0700 | [diff] [blame] | 71 | `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 Zverovich | 740385d | 2020-10-24 11:18:33 -0700 | [diff] [blame] | 74 | 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 Zverovich | c10e3f7 | 2020-10-25 07:29:24 -0700 | [diff] [blame] | 86 | (`#1819 <https://github.com/fmtlib/fmt/issues/1819>`_, |
| 87 | `#1837 <https://github.com/fmtlib/fmt/pull/1837>`_). For example |
Victor Zverovich | 740385d | 2020-10-24 11:18:33 -0700 | [diff] [blame] | 88 | (`godbolt <https://godbolt.org/z/c4M6fh>`__): |
Victor Zverovich | cd46511 | 2020-10-24 09:24:47 -0700 | [diff] [blame] | 89 | |
| 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 Zverovich | cd46511 | 2020-10-24 09:24:47 -0700 | [diff] [blame] | 101 | * Added support for ranges with non-const ``begin``/``end`` to ``fmt::join`` |
Victor Zverovich | e542e69 | 2020-10-25 06:46:45 -0700 | [diff] [blame] | 102 | (`#1784 <https://github.com/fmtlib/fmt/issues/1784>`_, |
| 103 | `#1786 <https://github.com/fmtlib/fmt/pull/1786>`_). For example |
Victor Zverovich | 740385d | 2020-10-24 11:18:33 -0700 | [diff] [blame] | 104 | (`godbolt <https://godbolt.org/z/jP63Tv>`__): |
Victor Zverovich | cd46511 | 2020-10-24 09:24:47 -0700 | [diff] [blame] | 105 | |
| 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 Zverovich | e542e69 | 2020-10-25 06:46:45 -0700 | [diff] [blame] | 125 | (`#1806 <https://github.com/fmtlib/fmt/pull/1806>`_). |
Victor Zverovich | cd46511 | 2020-10-24 09:24:47 -0700 | [diff] [blame] | 126 | Thanks `@BRevzin (Barry Revzin) <https://github.com/BRevzin>`_. |
| 127 | |
Victor Zverovich | 5024742 | 2020-10-22 09:27:49 -0700 | [diff] [blame] | 128 | * Improved handling of single code units in ``FMT_COMPILE``. For example: |
Victor Zverovich | 0452a4e | 2020-10-22 09:08:30 -0700 | [diff] [blame] | 129 | |
| 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 Zverovich | 46291be | 2020-10-23 07:38:01 -0700 | [diff] [blame] | 155 | Here a single ``mov`` instruction writes ``'x'`` (``$120``) to the output |
| 156 | buffer. |
Victor Zverovich | 0452a4e | 2020-10-22 09:08:30 -0700 | [diff] [blame] | 157 | |
Victor Zverovich | cd46511 | 2020-10-24 09:24:47 -0700 | [diff] [blame] | 158 | * Added dynamic width support to format string compilation |
Victor Zverovich | e542e69 | 2020-10-25 06:46:45 -0700 | [diff] [blame] | 159 | (`#1809 <https://github.com/fmtlib/fmt/issues/1809>`_). |
Victor Zverovich | cd46511 | 2020-10-24 09:24:47 -0700 | [diff] [blame] | 160 | |
Victor Zverovich | 0452a4e | 2020-10-22 09:08:30 -0700 | [diff] [blame] | 161 | * 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 Zverovich | 39bde32 | 2020-10-25 09:19:38 -0700 | [diff] [blame] | 176 | ``fmt/core.h:1438:3: error: static_assert failed due to requirement |
Victor Zverovich | 204d299 | 2020-10-25 09:12:22 -0700 | [diff] [blame] | 177 | '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 Zverovich | 39bde32 | 2020-10-25 09:19:38 -0700 | [diff] [blame] | 180 | ...`` |
Victor Zverovich | 0452a4e | 2020-10-22 09:08:30 -0700 | [diff] [blame] | 181 | |
Victor Zverovich | e542e69 | 2020-10-25 06:46:45 -0700 | [diff] [blame] | 182 | * Added the `make_args_checked <https://fmt.dev/7.1.0/api.html#argument-lists>`_ |
Victor Zverovich | 46291be | 2020-10-23 07:38:01 -0700 | [diff] [blame] | 183 | function template that allows you to write formatting functions with |
Victor Zverovich | 62c7205 | 2020-10-25 08:56:46 -0700 | [diff] [blame] | 184 | compile-time format string checks and avoid binary code bloat |
Victor Zverovich | cd46511 | 2020-10-24 09:24:47 -0700 | [diff] [blame] | 185 | (`godbolt <https://godbolt.org/z/PEf9qr>`__): |
Victor Zverovich | 46291be | 2020-10-23 07:38:01 -0700 | [diff] [blame] | 186 | |
| 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 Zverovich | 740385d | 2020-10-24 11:18:33 -0700 | [diff] [blame] | 206 | * 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 Zverovich | 62c7205 | 2020-10-25 08:56:46 -0700 | [diff] [blame] | 218 | prints |
| 219 | |
| 220 | ``4.9406564584124654417656879286822137236505980261432476442558568250067550727020875186529983636163599237979656469544571773092665671035593979639877479601078187812630071319031140452784581716784898210368871863605699873072305000638740915356498438731247339727316961514003171538539807412623856559117102665855668676818703956031062493194527159149245532930545654440112748012970999954193198940908041656332452475714786901472678015935523861155013480352649347201937902681071074917033322268447533357208324319360923829e-324``. |
Victor Zverovich | 740385d | 2020-10-24 11:18:33 -0700 | [diff] [blame] | 221 | |
Victor Zverovich | cd46511 | 2020-10-24 09:24:47 -0700 | [diff] [blame] | 222 | * Made ``format_to_n`` and ``formatted_size`` part of the `core API |
| 223 | <https://fmt.dev/latest/api.html#core-api>`__ |
Victor Zverovich | 62c7205 | 2020-10-25 08:56:46 -0700 | [diff] [blame] | 224 | (`godbolt <https://godbolt.org/z/sPjY1K>`__): |
Victor Zverovich | cd46511 | 2020-10-24 09:24:47 -0700 | [diff] [blame] | 225 | |
| 226 | .. code:: c++ |
| 227 | |
| 228 | #include <fmt/core.h> |
| 229 | |
| 230 | int main() { |
Victor Zverovich | 62c7205 | 2020-10-25 08:56:46 -0700 | [diff] [blame] | 231 | char buffer[10]; |
| 232 | auto result = fmt::format_to_n(buffer, sizeof(buffer), "{}", 42); |
Victor Zverovich | cd46511 | 2020-10-24 09:24:47 -0700 | [diff] [blame] | 233 | } |
| 234 | |
Victor Zverovich | 740385d | 2020-10-24 11:18:33 -0700 | [diff] [blame] | 235 | * 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 Zverovich | 62c7205 | 2020-10-25 08:56:46 -0700 | [diff] [blame] | 239 | (`godbolt <https://godbolt.org/z/93h86q>`__): |
Victor Zverovich | 740385d | 2020-10-24 11:18:33 -0700 | [diff] [blame] | 240 | |
| 241 | .. code:: c++ |
| 242 | |
| 243 | #include <fmt/compile.h> |
| 244 | |
| 245 | int main() { |
Victor Zverovich | 62c7205 | 2020-10-25 08:56:46 -0700 | [diff] [blame] | 246 | char buffer[8]; |
| 247 | fmt::format_to_n(buffer, sizeof(buffer), FMT_COMPILE("{}"), 42); |
Victor Zverovich | 740385d | 2020-10-24 11:18:33 -0700 | [diff] [blame] | 248 | } |
| 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 Zverovich | 6a77ea3 | 2020-10-25 08:59:36 -0700 | [diff] [blame] | 272 | * Made the ``#`` specifier emit trailing zeros in addition to the decimal point |
Victor Zverovich | c10e3f7 | 2020-10-25 07:29:24 -0700 | [diff] [blame] | 273 | (`#1797 <https://github.com/fmtlib/fmt/issues/1797>`_). For example |
Victor Zverovich | cd46511 | 2020-10-24 09:24:47 -0700 | [diff] [blame] | 274 | (`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 Zverovich | 6a77ea3 | 2020-10-25 08:59:36 -0700 | [diff] [blame] | 284 | prints ``0.50``. |
Victor Zverovich | cd46511 | 2020-10-24 09:24:47 -0700 | [diff] [blame] | 285 | |
Victor Zverovich | c10e3f7 | 2020-10-25 07:29:24 -0700 | [diff] [blame] | 286 | * 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 Zverovich | 62c7205 | 2020-10-25 08:56:46 -0700 | [diff] [blame] | 295 | `#1917 <https://github.com/fmtlib/fmt/issues/1917>`_). |
Victor Zverovich | c10e3f7 | 2020-10-25 07:29:24 -0700 | [diff] [blame] | 296 | |
Victor Zverovich | cd46511 | 2020-10-24 09:24:47 -0700 | [diff] [blame] | 297 | * 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 Zverovich | 740385d | 2020-10-24 11:18:33 -0700 | [diff] [blame] | 303 | * 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 Zverovich | cd46511 | 2020-10-24 09:24:47 -0700 | [diff] [blame] | 307 | Thanks `@t-wiser <https://github.com/t-wiser>`_. |
| 308 | |
Victor Zverovich | 0452a4e | 2020-10-22 09:08:30 -0700 | [diff] [blame] | 309 | * Fixed handling of types that have both an implicit conversion operator and |
Victor Zverovich | 62c7205 | 2020-10-25 08:56:46 -0700 | [diff] [blame] | 310 | an overloaded ``ostream`` insertion operator |
Victor Zverovich | 0452a4e | 2020-10-22 09:08:30 -0700 | [diff] [blame] | 311 | (`#1766 <https://github.com/fmtlib/fmt/issues/1766>`_). |
| 312 | |
Victor Zverovich | cd46511 | 2020-10-24 09:24:47 -0700 | [diff] [blame] | 313 | * 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 Zverovich | e542e69 | 2020-10-25 06:46:45 -0700 | [diff] [blame] | 317 | * 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 Zverovich | c10e3f7 | 2020-10-25 07:29:24 -0700 | [diff] [blame] | 321 | (`#1870 <https://github.com/fmtlib/fmt/issues/1870>`_, |
| 322 | `#1932 <https://github.com/fmtlib/fmt/issues/1932>`_). |
Victor Zverovich | e542e69 | 2020-10-25 06:46:45 -0700 | [diff] [blame] | 323 | |
Victor Zverovich | 740385d | 2020-10-24 11:18:33 -0700 | [diff] [blame] | 324 | * Improved ``FMT_ALWAYS_INLINE`` |
Victor Zverovich | e542e69 | 2020-10-25 06:46:45 -0700 | [diff] [blame] | 325 | (`#1878 <https://github.com/fmtlib/fmt/pull/1878>`_). |
Victor Zverovich | 740385d | 2020-10-24 11:18:33 -0700 | [diff] [blame] | 326 | Thanks `@jk-jeon (Junekey Jeon) <https://github.com/jk-jeon>`_. |
| 327 | |
Victor Zverovich | e542e69 | 2020-10-25 06:46:45 -0700 | [diff] [blame] | 328 | * 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 Zverovich | 740385d | 2020-10-24 11:18:33 -0700 | [diff] [blame] | 332 | * Optimized counting of decimal digits on MSVC |
Victor Zverovich | e542e69 | 2020-10-25 06:46:45 -0700 | [diff] [blame] | 333 | (`#1890 <https://github.com/fmtlib/fmt/pull/1890>`_). |
Victor Zverovich | 740385d | 2020-10-24 11:18:33 -0700 | [diff] [blame] | 334 | Thanks `@mwinterb <https://github.com/mwinterb>`_. |
| 335 | |
Victor Zverovich | 46291be | 2020-10-23 07:38:01 -0700 | [diff] [blame] | 336 | * Improved documentation |
Victor Zverovich | e542e69 | 2020-10-25 06:46:45 -0700 | [diff] [blame] | 337 | (`#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 Zverovich | 62c7205 | 2020-10-25 08:56:46 -0700 | [diff] [blame] | 342 | `#1918 <https://github.com/fmtlib/fmt/pull/1918>`_, |
| 343 | `#1939 <https://github.com/fmtlib/fmt/pull/1939>`_). |
Victor Zverovich | cd46511 | 2020-10-24 09:24:47 -0700 | [diff] [blame] | 344 | Thanks `@leolchat (LĂ©onard GĂ©rard) <https://github.com/leolchat>`_, |
| 345 | `@pepsiman (Malcolm Parsons) <https://github.com/pepsiman>`_, |
Victor Zverovich | 740385d | 2020-10-24 11:18:33 -0700 | [diff] [blame] | 346 | `@Klaim (Joël Lamotte) <https://github.com/Klaim>`_, |
Victor Zverovich | e542e69 | 2020-10-25 06:46:45 -0700 | [diff] [blame] | 347 | `@ravijanjam (Ravi J) <https://github.com/ravijanjam>`_, |
| 348 | `@francesco-st <https://github.com/francesco-st>`_, |
| 349 | `@udnaan (Adnan) <https://github.com/udnaan>`_. |
Victor Zverovich | 46291be | 2020-10-23 07:38:01 -0700 | [diff] [blame] | 350 | |
| 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 Zverovich | e542e69 | 2020-10-25 06:46:45 -0700 | [diff] [blame] | 358 | * 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 Zverovich | 740385d | 2020-10-24 11:18:33 -0700 | [diff] [blame] | 362 | * Improved build configuration |
Victor Zverovich | 0452a4e | 2020-10-22 09:08:30 -0700 | [diff] [blame] | 363 | (`#1760 <https://github.com/fmtlib/fmt/pull/1760>`_, |
Victor Zverovich | 46291be | 2020-10-23 07:38:01 -0700 | [diff] [blame] | 364 | `#1770 <https://github.com/fmtlib/fmt/pull/1770>`_, |
Victor Zverovich | cd46511 | 2020-10-24 09:24:47 -0700 | [diff] [blame] | 365 | `#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 Zverovich | 0452a4e | 2020-10-22 09:08:30 -0700 | [diff] [blame] | 368 | Thanks `@dvetutnev (Dmitriy Vetutnev) <https://github.com/dvetutnev>`_, |
Victor Zverovich | 46291be | 2020-10-23 07:38:01 -0700 | [diff] [blame] | 369 | `@xvitaly (Vitaly Zaitsev) <https://github.com/xvitaly>`_, |
Victor Zverovich | cd46511 | 2020-10-24 09:24:47 -0700 | [diff] [blame] | 370 | `@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 Zverovich | 740385d | 2020-10-24 11:18:33 -0700 | [diff] [blame] | 386 | `#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 Zverovich | e542e69 | 2020-10-25 06:46:45 -0700 | [diff] [blame] | 392 | `#1880 <https://github.com/fmtlib/fmt/pull/1880>`_, |
Victor Zverovich | c10e3f7 | 2020-10-25 07:29:24 -0700 | [diff] [blame] | 393 | `#1896 <https://github.com/fmtlib/fmt/issues/1896>`_, |
Victor Zverovich | e542e69 | 2020-10-25 06:46:45 -0700 | [diff] [blame] | 394 | `#1897 <https://github.com/fmtlib/fmt/pull/1897>`_, |
| 395 | `#1898 <https://github.com/fmtlib/fmt/pull/1898>`_, |
Victor Zverovich | c10e3f7 | 2020-10-25 07:29:24 -0700 | [diff] [blame] | 396 | `#1904 <https://github.com/fmtlib/fmt/issues/1904>`_, |
Victor Zverovich | e542e69 | 2020-10-25 06:46:45 -0700 | [diff] [blame] | 397 | `#1908 <https://github.com/fmtlib/fmt/pull/1908>`_, |
Victor Zverovich | c10e3f7 | 2020-10-25 07:29:24 -0700 | [diff] [blame] | 398 | `#1911 <https://github.com/fmtlib/fmt/issues/1911>`_, |
Victor Zverovich | e542e69 | 2020-10-25 06:46:45 -0700 | [diff] [blame] | 399 | `#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 Zverovich | c10e3f7 | 2020-10-25 07:29:24 -0700 | [diff] [blame] | 404 | `#1942 <https://github.com/fmtlib/fmt/pull/1942>`_, |
| 405 | `#1949 <https://github.com/fmtlib/fmt/issues/1949>`_). |
Victor Zverovich | cd46511 | 2020-10-24 09:24:47 -0700 | [diff] [blame] | 406 | 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 Zverovich | 740385d | 2020-10-24 11:18:33 -0700 | [diff] [blame] | 412 | `@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 Zverovich | e542e69 | 2020-10-25 06:46:45 -0700 | [diff] [blame] | 418 | `@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 Zverovich | da8278e | 2020-10-19 14:37:14 -0700 | [diff] [blame] | 425 | |
Victor Zverovich | cd4af11 | 2020-08-06 08:51:01 -0700 | [diff] [blame] | 426 | 7.0.3 - 2020-08-06 |
| 427 | ------------------ |
Victor Zverovich | 72920ba | 2020-08-06 07:34:56 -0700 | [diff] [blame] | 428 | |
| 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 Zverovich | f4c9970 | 2020-08-06 07:40:46 -0700 | [diff] [blame] | 439 | * Fixed issues in locale-specific integer formatting |
Victor Zverovich | 72920ba | 2020-08-06 07:34:56 -0700 | [diff] [blame] | 440 | (`#1782 <https://github.com/fmtlib/fmt/issues/1782>`_, |
Victor Zverovich | f4c9970 | 2020-08-06 07:40:46 -0700 | [diff] [blame] | 441 | `#1801 <https://github.com/fmtlib/fmt/issues/1801>`_). |
Victor Zverovich | 72920ba | 2020-08-06 07:34:56 -0700 | [diff] [blame] | 442 | |
Victor Zverovich | b9d7490 | 2020-07-29 07:30:55 -0700 | [diff] [blame] | 443 | 7.0.2 - 2020-07-29 |
| 444 | ------------------ |
Victor Zverovich | cbf6be9 | 2020-07-28 09:15:02 -0700 | [diff] [blame] | 445 | |
| 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 Zverovich | f19b1a5 | 2020-07-07 07:47:44 -0700 | [diff] [blame] | 455 | 7.0.1 - 2020-07-07 |
| 456 | ------------------ |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 457 | |
Victor Zverovich | f1dd2eb | 2020-07-07 06:24:32 -0700 | [diff] [blame] | 458 | * 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 Zverovich | 6be6762 | 2020-07-07 06:32:19 -0700 | [diff] [blame] | 469 | 7.0.0 - 2020-07-05 |
Victor Zverovich | f1dd2eb | 2020-07-07 06:24:32 -0700 | [diff] [blame] | 470 | ------------------ |
| 471 | |
Victor Zverovich | 7dbc8ac | 2020-07-05 06:29:05 -0700 | [diff] [blame] | 472 | * Reduced the library size. For example, on macOS a stripped test binary |
Victor Zverovich | c87dd74 | 2020-07-05 06:20:50 -0700 | [diff] [blame] | 473 | 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 Zverovich | 1614af3 | 2020-07-05 08:43:01 -0700 | [diff] [blame] | 476 | * Added a simpler and more efficient `format string compilation API |
Victor Zverovich | cd46511 | 2020-10-24 09:24:47 -0700 | [diff] [blame] | 477 | <https://fmt.dev/7.0.0/api.html#compile-api>`_: |
Victor Zverovich | c87dd74 | 2020-07-05 06:20:50 -0700 | [diff] [blame] | 478 | |
| 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 Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 488 | |
| 489 | * Optimized integer formatting: ``format_to`` with format string compilation |
Victor Zverovich | 7dbc8ac | 2020-07-05 06:29:05 -0700 | [diff] [blame] | 490 | and a stack-allocated buffer is now `faster than to_chars on both |
Victor Zverovich | c87dd74 | 2020-07-05 06:20:50 -0700 | [diff] [blame] | 491 | libc++ and libstdc++ |
| 492 | <http://www.zverovich.net/2020/06/13/fast-int-to-string-revisited.html>`_. |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 493 | |
Victor Zverovich | 7dbc8ac | 2020-07-05 06:29:05 -0700 | [diff] [blame] | 494 | * 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 Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 502 | * Applied extern templates to improve compile times when using the core API |
Victor Zverovich | 7dbc8ac | 2020-07-05 06:29:05 -0700 | [diff] [blame] | 503 | 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 Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 507 | |
| 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 Zverovich | 1614af3 | 2020-07-05 08:43:01 -0700 | [diff] [blame] | 529 | the compile time difference is now smaller. Thanks |
| 530 | `@alex3d <https://github.com/alex3d>`_ for the suggestion. |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 531 | |
| 532 | * Named arguments are now stored on stack (no dynamic memory allocations) and |
Victor Zverovich | 7dbc8ac | 2020-07-05 06:29:05 -0700 | [diff] [blame] | 533 | the compiled code is more compact and efficient. For example |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 534 | |
| 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 Zverovich | c87dd74 | 2020-07-05 06:20:50 -0700 | [diff] [blame] | 563 | call fmt::v6::vprint(fmt::v6::basic_string_view<char>, |
| 564 | fmt::v6::format_args) |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 565 | xor eax, eax |
| 566 | add rsp, 56 |
| 567 | ret |
| 568 | |
| 569 | .L.str.1: |
| 570 | .asciz "answer" |
| 571 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 572 | * Implemented compile-time checks for dynamic width and precision |
| 573 | (`#1614 <https://github.com/fmtlib/fmt/issues/1614>`_): |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 574 | |
| 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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 596 | * Added sentinel support to ``fmt::join`` |
Victor Zverovich | a29a01d | 2020-07-06 09:50:24 -0700 | [diff] [blame] | 597 | (`#1689 <https://github.com/fmtlib/fmt/pull/1689>`_) |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 598 | |
| 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 Zverovich | 0452a4e | 2020-10-22 09:08:30 -0700 | [diff] [blame] | 616 | * Added support for named arguments, ``clear`` and ``reserve`` to |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 617 | ``dynamic_format_arg_store`` |
| 618 | (`#1655 <https://github.com/fmtlib/fmt/issues/1655>`_, |
| 619 | `#1663 <https://github.com/fmtlib/fmt/pull/1663>`_, |
Victor Zverovich | c87dd74 | 2020-07-05 06:20:50 -0700 | [diff] [blame] | 620 | `#1674 <https://github.com/fmtlib/fmt/pull/1674>`_, |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 621 | `#1677 <https://github.com/fmtlib/fmt/pull/1677>`_). |
| 622 | Thanks `@vsolontsov-ll (Vladimir Solontsov) |
| 623 | <https://github.com/vsolontsov-ll>`_. |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 624 | |
| 625 | * Added support for the ``'c'`` format specifier to integral types for |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 626 | compatibility with ``std::format`` |
| 627 | (`#1652 <https://github.com/fmtlib/fmt/issues/1652>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 628 | |
Victor Zverovich | 7dbc8ac | 2020-07-05 06:29:05 -0700 | [diff] [blame] | 629 | * 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 Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 633 | |
| 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 Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 638 | * Removed the following deprecated APIs: |
| 639 | |
Victor Zverovich | c87dd74 | 2020-07-05 06:20:50 -0700 | [diff] [blame] | 640 | * ``FMT_STRING_ALIAS`` and ``fmt`` macros - replaced by ``FMT_STRING`` |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 641 | * ``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 Zverovich | c87dd74 | 2020-07-05 06:20:50 -0700 | [diff] [blame] | 647 | * ``FMT_DEPRECATED_PERCENT`` - incompatible with ``std::format`` |
| 648 | * ``*writer`` - replaced by compiled format API |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 649 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 650 | * 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 Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 653 | |
Victor Zverovich | 7dbc8ac | 2020-07-05 06:29:05 -0700 | [diff] [blame] | 654 | * 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 Zverovich | 1614af3 | 2020-07-05 08:43:01 -0700 | [diff] [blame] | 662 | * Fixed handling of ``operator<<`` overloads that use ``copyfmt`` |
Victor Zverovich | 7dbc8ac | 2020-07-05 06:29:05 -0700 | [diff] [blame] | 663 | (`#1666 <https://github.com/fmtlib/fmt/issues/1666>`_). |
| 664 | |
Victor Zverovich | c87dd74 | 2020-07-05 06:20:50 -0700 | [diff] [blame] | 665 | * 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 Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 672 | * Replaced ``FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION`` with the ``FMT_FUZZ`` |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 673 | macro to prevent interferring with fuzzing of projects using {fmt} |
| 674 | (`#1650 <https://github.com/fmtlib/fmt/pull/1650>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 675 | Thanks `@asraa (Asra Ali) <https://github.com/asraa>`_. |
| 676 | |
Victor Zverovich | c87dd74 | 2020-07-05 06:20:50 -0700 | [diff] [blame] | 677 | * 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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 683 | * 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 Zverovich | c87dd74 | 2020-07-05 06:20:50 -0700 | [diff] [blame] | 688 | `#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 Zverovich | 7dbc8ac | 2020-07-05 06:29:05 -0700 | [diff] [blame] | 694 | `#1741 <https://github.com/fmtlib/fmt/pull/1741>`_, |
| 695 | `#1751 <https://github.com/fmtlib/fmt/pull/1751>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 696 | 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 Zverovich | c87dd74 | 2020-07-05 06:20:50 -0700 | [diff] [blame] | 699 | `@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 Zverovich | 7dbc8ac | 2020-07-05 06:29:05 -0700 | [diff] [blame] | 703 | `@gsjaardema (Greg Sjaardema) <https://github.com/gsjaardema>`_, |
| 704 | `@alexey-milovidov <https://github.com/alexey-milovidov>`_. |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 705 | |
| 706 | * Implemented various build configuration fixes and improvements |
Victor Zverovich | c87dd74 | 2020-07-05 06:20:50 -0700 | [diff] [blame] | 707 | (`#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 Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 715 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 716 | * Fixed various warnings and compilation issues |
| 717 | (`#1616 <https://github.com/fmtlib/fmt/pull/1616>`_, |
Victor Zverovich | c87dd74 | 2020-07-05 06:20:50 -0700 | [diff] [blame] | 718 | `#1620 <https://github.com/fmtlib/fmt/issues/1620>`_, |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 719 | `#1622 <https://github.com/fmtlib/fmt/issues/1622>`_, |
Victor Zverovich | c87dd74 | 2020-07-05 06:20:50 -0700 | [diff] [blame] | 720 | `#1625 <https://github.com/fmtlib/fmt/issues/1625>`_, |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 721 | `#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 Zverovich | c87dd74 | 2020-07-05 06:20:50 -0700 | [diff] [blame] | 730 | `#1668 <https://github.com/fmtlib/fmt/issues/1668>`_, |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 731 | `#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 Zverovich | c87dd74 | 2020-07-05 06:20:50 -0700 | [diff] [blame] | 734 | `#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 Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 747 | Thanks `@gsjaardema (Greg Sjaardema) <https://github.com/gsjaardema>`_, |
| 748 | `@gabime (Gabi Melman) <https://github.com/gabime>`_, |
| 749 | `@johnor (Johan) <https://github.com/johnor>`_, |
Victor Zverovich | 5c67fef | 2020-07-07 06:58:44 -0700 | [diff] [blame] | 750 | `@Kurkin (Dmitry Kurkin) <https://github.com/Kurkin>`_, |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 751 | `@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 Zverovich | c87dd74 | 2020-07-05 06:20:50 -0700 | [diff] [blame] | 755 | `@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 Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 761 | |
| 762 | 6.2.1 - 2020-05-09 |
| 763 | ------------------ |
| 764 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 765 | * Fixed ostream support in ``sprintf`` |
| 766 | (`#1631 <https://github.com/fmtlib/fmt/issues/1631>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 767 | |
| 768 | * Fixed type detection when using implicit conversion to ``string_view`` and |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 769 | ostream ``operator<<`` inconsistently |
| 770 | (`#1662 <https://github.com/fmtlib/fmt/issues/1662>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 771 | |
| 772 | 6.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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 800 | * 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 Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 803 | |
| 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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 826 | * Improved UTF-8 handling |
| 827 | (`#1109 <https://github.com/fmtlib/fmt/issues/1109>`_): |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 828 | |
| 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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 843 | * Added experimental dynamic argument storage |
| 844 | (`#1170 <https://github.com/fmtlib/fmt/issues/1170>`_, |
| 845 | `#1584 <https://github.com/fmtlib/fmt/pull/1584>`_): |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 846 | |
| 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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 861 | * Made ``fmt::join`` accept ``initializer_list`` |
| 862 | (`#1591 <https://github.com/fmtlib/fmt/pull/1591>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 863 | Thanks `@Rapotkinnik (Nikolay Rapotkin) <https://github.com/Rapotkinnik>`_. |
| 864 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 865 | * Fixed handling of empty tuples |
| 866 | (`#1588 <https://github.com/fmtlib/fmt/issues/1588>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 867 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 868 | * Fixed handling of output iterators in ``format_to_n`` |
| 869 | (`#1506 <https://github.com/fmtlib/fmt/issues/1506>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 870 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 871 | * Fixed formatting of ``std::chrono::duration`` types to wide output |
| 872 | (`#1533 <https://github.com/fmtlib/fmt/pull/1533>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 873 | Thanks `@zeffy (pilao) <https://github.com/zeffy>`_. |
| 874 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 875 | * Added const ``begin`` and ``end`` overload to buffers |
| 876 | (`#1553 <https://github.com/fmtlib/fmt/pull/1553>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 877 | 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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 881 | memory-constrained embedded system |
| 882 | (`#1590 <https://github.com/fmtlib/fmt/pull/1590>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 883 | Thanks `@albaguirre (Alberto Aguirre) <https://github.com/albaguirre>`_. |
| 884 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 885 | * Made ``FMT_STRING`` work with ``constexpr`` ``string_view`` |
| 886 | (`#1589 <https://github.com/fmtlib/fmt/pull/1589>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 887 | Thanks `@scramsby (Scott Ramsby) <https://github.com/scramsby>`_. |
| 888 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 889 | * Implemented a minor optimization in the format string parser |
| 890 | (`#1560 <https://github.com/fmtlib/fmt/pull/1560>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 891 | Thanks `@IkarusDeveloper <https://github.com/IkarusDeveloper>`_. |
| 892 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 893 | * 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 Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 897 | 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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 901 | * Improved documentation |
| 902 | (`#1481 <https://github.com/fmtlib/fmt/pull/1481>`_, |
| 903 | `#1523 <https://github.com/fmtlib/fmt/pull/1523>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 904 | 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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 908 | (`#1535 <https://github.com/fmtlib/fmt/pull/1535>`_). |
| 909 | Thanks `@milianw (Milian Wolff) <https://github.com/milianw>`_. |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 910 | |
| 911 | * Implemented various build configuration fixes and improvements |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 912 | (`#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 Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 922 | 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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 927 | (`#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 Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 968 | 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 | |
| 985 | 6.1.2 - 2019-12-11 |
| 986 | ------------------ |
| 987 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 988 | * Fixed ABI compatibility with ``libfmt.so.6.0.0`` |
| 989 | (`#1471 <https://github.com/fmtlib/fmt/issues/1471>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 990 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 991 | * Fixed handling types convertible to ``std::string_view`` |
| 992 | (`#1451 <https://github.com/fmtlib/fmt/pull/1451>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 993 | 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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 997 | * Fixed sign conversion warnings |
| 998 | (`#1440 <https://github.com/fmtlib/fmt/pull/1440>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 999 | Thanks `@0x8000-0000 (Florin Iucha) <https://github.com/0x8000-0000>`_. |
| 1000 | |
| 1001 | 6.1.1 - 2019-12-04 |
| 1002 | ------------------ |
| 1003 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 1004 | * 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 Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 1010 | `@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 | |
| 1016 | 6.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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 1055 | (`#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 Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 1059 | |
| 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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 1069 | (`#1376 <https://github.com/fmtlib/fmt/issues/1376>`_, |
| 1070 | `#1417 <https://github.com/fmtlib/fmt/issues/1417>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 1071 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 1072 | * Added support for 128-bit integers |
| 1073 | (`#1287 <https://github.com/fmtlib/fmt/pull/1287>`_): |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 1074 | |
| 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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 1084 | output from different threads doesn't interleave |
| 1085 | (`#1351 <https://github.com/fmtlib/fmt/pull/1351>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 1086 | 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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 1093 | (`#1322 <https://github.com/fmtlib/fmt/issues/1322>`_, |
| 1094 | `#1330 <https://github.com/fmtlib/fmt/pull/1330>`_): |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 1095 | |
| 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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 1118 | * The locale is now passed to ostream insertion (``<<``) operators |
| 1119 | (`#1406 <https://github.com/fmtlib/fmt/pull/1406>`_): |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 1120 | |
| 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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 1141 | * 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 Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 1144 | Thanks `@skrdaniel <https://github.com/skrdaniel>`_. |
| 1145 | |
| 1146 | * Fixed handling of types with deleted implicit rvalue conversion to |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 1147 | ``const char**`` (`#1421 <https://github.com/fmtlib/fmt/issues/1421>`_): |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 1148 | |
| 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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 1161 | (`#1286 <https://github.com/fmtlib/fmt/pull/1286>`_). |
| 1162 | Thanks `@agmt (Egor Seredin) <https://github.com/agmt>`_. |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 1163 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 1164 | * Enum classes are no longer implicitly converted to ``int`` |
| 1165 | (`#1424 <https://github.com/fmtlib/fmt/issues/1424>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 1166 | |
| 1167 | * Added ``basic_format_parse_context`` for consistency with C++20 |
| 1168 | ``std::format`` and deprecated ``basic_parse_context``. |
| 1169 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 1170 | * 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 Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 1173 | 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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 1178 | `package <https://github.com/conda-forge/fmt-feedstock>`__ |
| 1179 | (`#1410 <https://github.com/fmtlib/fmt/pull/1410>`_):: |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 1180 | |
| 1181 | conda install -c conda-forge fmt |
| 1182 | |
| 1183 | Thanks `@tdegeus (Tom de Geus) <https://github.com/tdegeus>`_. |
| 1184 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 1185 | * Added a CUDA test (`#1285 <https://github.com/fmtlib/fmt/pull/1285>`_, |
| 1186 | `#1317 <https://github.com/fmtlib/fmt/pull/1317>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 1187 | Thanks `@luncliff (Park DongHa) <https://github.com/luncliff>`_ and |
| 1188 | `@risa2000 <https://github.com/risa2000>`_. |
| 1189 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 1190 | * 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 Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 1199 | `@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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 1203 | * Various code improvements |
| 1204 | (`#1358 <https://github.com/fmtlib/fmt/pull/1358>`_, |
| 1205 | `#1407 <https://github.com/fmtlib/fmt/pull/1407>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 1206 | Thanks `@orivej (Orivej Desh) <https://github.com/orivej>`_, |
| 1207 | `@dpacbach (David P. Sicilia) <https://github.com/dpacbach>`_, |
| 1208 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 1209 | * Fixed compile-time format string checks for user-defined types |
| 1210 | (`#1292 <https://github.com/fmtlib/fmt/issues/1292>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 1211 | |
| 1212 | * Worked around a false positive in ``unsigned-integer-overflow`` sanitizer |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 1213 | (`#1377 <https://github.com/fmtlib/fmt/issues/1377>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 1214 | |
| 1215 | * Fixed various warnings and compilation issues |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 1216 | (`#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 Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 1252 | 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 | |
| 1267 | 6.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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 1321 | * Added `oss-fuzz <https://github.com/google/oss-fuzz>`_ support |
| 1322 | (`#1199 <https://github.com/fmtlib/fmt/pull/1199>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 1323 | Thanks `@pauldreik (Paul Dreik) <https://github.com/pauldreik>`_. |
| 1324 | |
| 1325 | * ``formatter`` specializations now always take precedence over ``operator<<`` |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 1326 | (`#952 <https://github.com/fmtlib/fmt/issues/952>`_): |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 1327 | |
| 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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 1352 | 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 Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 1355 | |
| 1356 | .. code:: c++ |
| 1357 | |
| 1358 | #include <fmt/compile.h> |
| 1359 | |
| 1360 | auto f = fmt::compile<int>("{}"); |
Victor Zverovich | c87dd74 | 2020-07-05 06:20:50 -0700 | [diff] [blame] | 1361 | std::string s = fmt::format(f, 42); // can be called multiple times to |
| 1362 | // format different values |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 1363 | // 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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 1370 | 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 Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 1373 | |
| 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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 1380 | * 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 Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 1383 | |
| 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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 1392 | and the unit respectively (`#1019 <https://github.com/fmtlib/fmt/pull/1019>`_): |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 1393 | |
| 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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 1414 | (`#993 <https://github.com/fmtlib/fmt/issues/993>`_, |
| 1415 | `#994 <https://github.com/fmtlib/fmt/pull/994>`_): |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 1416 | |
| 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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 1430 | ``fmt::ptr`` (`#1121 <https://github.com/fmtlib/fmt/pull/1121>`_): |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 1431 | |
| 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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 1439 | * 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 Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 1442 | Thanks `@BillyDonahue (Billy Donahue) <https://github.com/BillyDonahue>`_. |
| 1443 | |
| 1444 | * Marked deprecated APIs with the ``[[deprecated]]`` attribute and removed |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 1445 | internal uses of deprecated APIs |
| 1446 | (`#1022 <https://github.com/fmtlib/fmt/pull/1022>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 1447 | 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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 1471 | 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 Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 1474 | Thanks `@jackoalan (Jack Andersen) <https://github.com/jackoalan>`_. |
| 1475 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 1476 | * Improved literal-based API |
| 1477 | (`#1254 <https://github.com/fmtlib/fmt/pull/1254>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 1478 | Thanks `@sylveon (Charles Milette) <https://github.com/sylveon>`_. |
| 1479 | |
| 1480 | * Added support for exotic platforms without ``uintptr_t`` such as IBM i |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 1481 | (AS/400) which has 128-bit pointers and only 64-bit integers |
| 1482 | (`#1059 <https://github.com/fmtlib/fmt/issues/1059>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 1483 | |
| 1484 | * Added `Sublime Text syntax highlighting config |
| 1485 | <https://github.com/fmtlib/fmt/blob/master/support/C%2B%2B.sublime-syntax>`_ |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 1486 | (`#1037 <https://github.com/fmtlib/fmt/issues/1037>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 1487 | 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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 1490 | compile-time format strings |
| 1491 | (`#1231 <https://github.com/fmtlib/fmt/pull/1231>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 1492 | Thanks `@jackoalan (Jack Andersen) <https://github.com/jackoalan>`_. |
| 1493 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 1494 | * Stopped setting ``CMAKE_BUILD_TYPE`` if {fmt} is a subproject |
| 1495 | (`#1081 <https://github.com/fmtlib/fmt/issues/1081>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 1496 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 1497 | * 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 Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 1503 | 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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 1509 | * 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 Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 1520 | 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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 1527 | * Fixed ambiguous formatter specialization in ``fmt/ranges.h`` |
| 1528 | (`#1123 <https://github.com/fmtlib/fmt/issues/1123>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 1529 | |
| 1530 | * Fixed formatting of a non-empty ``std::filesystem::path`` which is an |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 1531 | infinitely deep range of its components |
| 1532 | (`#1268 <https://github.com/fmtlib/fmt/issues/1268>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 1533 | |
| 1534 | * Fixed handling of general output iterators when formatting characters |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 1535 | (`#1056 <https://github.com/fmtlib/fmt/issues/1056>`_, |
| 1536 | `#1058 <https://github.com/fmtlib/fmt/pull/1058>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 1537 | Thanks `@abolz (Alexander Bolz) <https://github.com/abolz>`_. |
| 1538 | |
| 1539 | * Fixed handling of output iterators in ``formatter`` specialization for |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 1540 | ranges (`#1064 <https://github.com/fmtlib/fmt/issues/1064>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 1541 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 1542 | * Fixed handling of exotic character types |
| 1543 | (`#1188 <https://github.com/fmtlib/fmt/issues/1188>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 1544 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 1545 | * Made chrono formatting work with exceptions disabled |
| 1546 | (`#1062 <https://github.com/fmtlib/fmt/issues/1062>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 1547 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 1548 | * Fixed DLL visibility issues |
| 1549 | (`#1134 <https://github.com/fmtlib/fmt/pull/1134>`_, |
| 1550 | `#1147 <https://github.com/fmtlib/fmt/pull/1147>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 1551 | Thanks `@denchat <https://github.com/denchat>`_. |
| 1552 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 1553 | * Disabled the use of UDL template extension on GCC 9 |
| 1554 | (`#1148 <https://github.com/fmtlib/fmt/issues/1148>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 1555 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 1556 | * Removed misplaced ``format`` compile-time checks from ``printf`` |
| 1557 | (`#1173 <https://github.com/fmtlib/fmt/issues/1173>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 1558 | |
| 1559 | * Fixed issues in the experimental floating-point formatter |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 1560 | (`#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 Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 1566 | Thanks `@alabuzhev (Alex Alabuzhev) <https://github.com/alabuzhev>`_. |
| 1567 | |
| 1568 | * Fixed bugs discovered by fuzzing or during fuzzing integration |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 1569 | (`#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 Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 1579 | Thanks `@pauldreik (Paul Dreik) <https://github.com/pauldreik>`_. |
| 1580 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 1581 | * Fixed building tests on FreeBSD and Hurd |
| 1582 | (`#1043 <https://github.com/fmtlib/fmt/issues/1043>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 1583 | Thanks `@jackyf (Eugene V. Lyubimkin) <https://github.com/jackyf>`_. |
| 1584 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 1585 | * 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 Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 1644 | 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 | |
| 1664 | 5.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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 1686 | 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 Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 1690 | |
| 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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 1711 | * 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 Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 1714 | |
| 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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 1731 | (`#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 Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 1737 | 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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 1752 | * Made ``std::string_view`` work as a format string |
| 1753 | (`#898 <https://github.com/fmtlib/fmt/pull/898>`_): |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 1754 | |
| 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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 1761 | * Added wide string support to compile-time format string checks |
| 1762 | (`#924 <https://github.com/fmtlib/fmt/pull/924>`_): |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 1763 | |
| 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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 1770 | * Made colored print functions work with wide strings |
| 1771 | (`#867 <https://github.com/fmtlib/fmt/pull/867>`_): |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 1772 | |
| 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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 1783 | * Introduced experimental Unicode support |
| 1784 | (`#628 <https://github.com/fmtlib/fmt/issues/628>`_, |
| 1785 | `#891 <https://github.com/fmtlib/fmt/pull/891>`_): |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 1786 | |
| 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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 1807 | * Constrained formatting functions on proper iterator types |
| 1808 | (`#921 <https://github.com/fmtlib/fmt/pull/921>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 1809 | Thanks `@DanielaE (Daniela Engert) <https://github.com/DanielaE>`_. |
| 1810 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 1811 | * Added ``make_printf_args`` and ``make_wprintf_args`` functions |
| 1812 | (`#934 <https://github.com/fmtlib/fmt/pull/934>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 1813 | 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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 1820 | iterator-based API |
| 1821 | (`#873 <https://github.com/fmtlib/fmt/issues/873>`_, |
| 1822 | `#902 <https://github.com/fmtlib/fmt/pull/902>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 1823 | 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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 1833 | * Fixed compilation on platforms with exotic ``double`` |
| 1834 | (`#878 <https://github.com/fmtlib/fmt/issues/878>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 1835 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 1836 | * 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 Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 1842 | 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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 1847 | meson and other build systems |
| 1848 | (`#916 <https://github.com/fmtlib/fmt/pull/916>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 1849 | Thanks `@colemickens (Cole Mickens) <https://github.com/colemickens>`_. |
| 1850 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 1851 | * 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 Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 1857 | 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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 1863 | * Improved ``string_view`` construction performance |
| 1864 | (`#914 <https://github.com/fmtlib/fmt/pull/914>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 1865 | Thanks `@gabime (Gabi Melman) <https://github.com/gabime>`_. |
| 1866 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 1867 | * Fixed non-matching char types |
| 1868 | (`#895 <https://github.com/fmtlib/fmt/pull/895>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 1869 | Thanks `@DanielaE (Daniela Engert) <https://github.com/DanielaE>`_. |
| 1870 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 1871 | * Fixed ``format_to_n`` with ``std::back_insert_iterator`` |
| 1872 | (`#913 <https://github.com/fmtlib/fmt/pull/913>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 1873 | Thanks `@DanielaE (Daniela Engert) <https://github.com/DanielaE>`_. |
| 1874 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 1875 | * Fixed locale-dependent formatting |
| 1876 | (`#905 <https://github.com/fmtlib/fmt/issues/905>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 1877 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 1878 | * 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 Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 1892 | 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 | |
| 1900 | 5.2.1 - 2018-09-21 |
| 1901 | ------------------ |
| 1902 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 1903 | * Fixed ``visit`` lookup issues on gcc 7 & 8 |
| 1904 | (`#870 <https://github.com/fmtlib/fmt/pull/870>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 1905 | 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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 1910 | (`#865 <https://github.com/fmtlib/fmt/issues/865>`_, |
| 1911 | `#868 <https://github.com/fmtlib/fmt/pull/868>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 1912 | Thanks `@hhggit (dual) <https://github.com/hhggit>`_. |
| 1913 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 1914 | * Improved error message when formatting unknown types |
| 1915 | (`#872 <https://github.com/fmtlib/fmt/pull/872>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 1916 | Thanks `@foonathan (Jonathan MĂŒller) <https://github.com/foonathan>`_, |
| 1917 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 1918 | * Disabled templated user-defined literals when compiled under nvcc |
| 1919 | (`#875 <https://github.com/fmtlib/fmt/pull/875>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 1920 | Thanks `@CandyGumdrop (Candy Gumdrop) <https://github.com/CandyGumdrop>`_, |
| 1921 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 1922 | * Fixed ``format_to`` formatting to ``wmemory_buffer`` |
| 1923 | (`#874 <https://github.com/fmtlib/fmt/issues/874>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 1924 | |
| 1925 | 5.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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 1956 | ``fmt::memory_buffer`` (`#783 <https://github.com/fmtlib/fmt/issues/783>`_): |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 1957 | |
| 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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 1985 | * 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 Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 1988 | Thanks `@MikePopoloski (Michael Popoloski) |
| 1989 | <https://github.com/MikePopoloski>`_. |
| 1990 | |
| 1991 | * Reduced executable size overhead for embedded targets using newlib nano by |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 1992 | making locale dependency optional |
| 1993 | (`#839 <https://github.com/fmtlib/fmt/pull/839>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 1994 | Thanks `@teajay-fr (Thomas Benard) <https://github.com/teajay-fr>`_. |
| 1995 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 1996 | * 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 Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 1999 | Thanks `@qis (Alexej Harm) <https://github.com/qis>`_. |
| 2000 | |
| 2001 | * Fixed formatting of user-defined types providing ``operator<<`` with |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2002 | ``format_to_n`` |
| 2003 | (`#806 <https://github.com/fmtlib/fmt/pull/806>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2004 | Thanks `@mkurdej (Marek Kurdej) <https://github.com/mkurdej>`_. |
| 2005 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2006 | * Fixed dynamic linkage of new symbols |
| 2007 | (`#808 <https://github.com/fmtlib/fmt/issues/808>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2008 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2009 | * Fixed global initialization issue |
| 2010 | (`#807 <https://github.com/fmtlib/fmt/issues/807>`_): |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2011 | |
| 2012 | .. code:: c++ |
| 2013 | |
| 2014 | // This works on compilers with constexpr support. |
| 2015 | static const std::string answer = fmt::format("{}", 42); |
| 2016 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2017 | * 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 Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2030 | Thanks `@henryiii (Henry Schreiner) <https://github.com/henryiii>`_, |
| 2031 | `@medithe <https://github.com/medithe>`_, and |
| 2032 | `@eliasdaler (Elias Daler) <https://github.com/eliasdaler>`_. |
| 2033 | |
| 2034 | 5.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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2049 | ``color`` enum) is now deprecated. |
| 2050 | (`#762 <https://github.com/fmtlib/fmt/issues/762>`_ |
| 2051 | `#767 <https://github.com/fmtlib/fmt/pull/767>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2052 | thanks `@Remotion (Remo) <https://github.com/Remotion>`_. |
| 2053 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2054 | * Added quotes to strings in ranges and tuples |
| 2055 | (`#766 <https://github.com/fmtlib/fmt/pull/766>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2056 | Thanks `@Remotion (Remo) <https://github.com/Remotion>`_. |
| 2057 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2058 | * Made ``format_to`` work with ``basic_memory_buffer`` |
| 2059 | (`#776 <https://github.com/fmtlib/fmt/issues/776>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2060 | |
| 2061 | * Added ``vformat_to_n`` and ``wchar_t`` overload of ``format_to_n`` |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2062 | (`#764 <https://github.com/fmtlib/fmt/issues/764>`_, |
| 2063 | `#769 <https://github.com/fmtlib/fmt/issues/769>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2064 | |
| 2065 | * Made ``is_range`` and ``is_tuple_like`` part of public (experimental) API |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2066 | 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 Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2069 | Thanks `@drrlvn (Dror Levin) <https://github.com/drrlvn>`_. |
| 2070 | |
| 2071 | * Added more compilers to continuous integration and increased ``FMT_PEDANTIC`` |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2072 | warning levels |
| 2073 | (`#736 <https://github.com/fmtlib/fmt/pull/736>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2074 | Thanks `@eliaskosunen (Elias Kosunen) <https://github.com/eliaskosunen>`_. |
| 2075 | |
| 2076 | * Fixed compilation with MSVC 2013. |
| 2077 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2078 | * Fixed handling of user-defined types in ``format_to`` |
| 2079 | (`#793 <https://github.com/fmtlib/fmt/issues/793>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2080 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2081 | * Forced linking of inline ``vformat`` functions into the library |
| 2082 | (`#795 <https://github.com/fmtlib/fmt/issues/795>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2083 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2084 | * Fixed incorrect call to on_align in ``'{:}='`` |
| 2085 | (`#750 <https://github.com/fmtlib/fmt/issues/750>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2086 | |
| 2087 | * Fixed floating-point formatting to a non-back_insert_iterator with sign & |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2088 | numeric alignment specified |
| 2089 | (`#756 <https://github.com/fmtlib/fmt/issues/756>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2090 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2091 | * Fixed formatting to an array with ``format_to_n`` |
| 2092 | (`#778 <https://github.com/fmtlib/fmt/issues/778>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2093 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2094 | * Fixed formatting of more than 15 named arguments |
| 2095 | (`#754 <https://github.com/fmtlib/fmt/issues/754>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2096 | |
| 2097 | * Fixed handling of compile-time strings when including ``fmt/ostream.h``. |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2098 | (`#768 <https://github.com/fmtlib/fmt/issues/768>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2099 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2100 | * 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 Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2111 | 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 | |
| 2117 | 5.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 Zverovich | cd46511 | 2020-10-24 09:24:47 -0700 | [diff] [blame] | 2133 | <https://fmt.dev/latest/api.html#compile-time-format-string-checks>`_. For |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2134 | 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 Zverovich | cd46511 | 2020-10-24 09:24:47 -0700 | [diff] [blame] | 2194 | <https://fmt.dev/latest/api.html#output-iterator-support>`_: |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2195 | |
| 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 Zverovich | cd46511 | 2020-10-24 09:24:47 -0700 | [diff] [blame] | 2205 | <https://fmt.dev/latest/api.html#_CPPv2N3fmt11format_to_nE8OutputItNSt6size_tE11string_viewDpRK4Args>`_ |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2206 | function that restricts the output to the specified number of characters |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2207 | (`#298 <https://github.com/fmtlib/fmt/issues/298>`_): |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2208 | |
| 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 Zverovich | cd46511 | 2020-10-24 09:24:47 -0700 | [diff] [blame] | 2216 | <https://fmt.dev/latest/api.html#_CPPv2N3fmt14formatted_sizeE11string_viewDpRK4Args>`_ |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2217 | 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 Zverovich | cd46511 | 2020-10-24 09:24:47 -0700 | [diff] [blame] | 2226 | providing a lightweight `core API <https://fmt.dev/latest/api.html#core-api>`_: |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2227 | |
| 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 Zverovich | cd46511 | 2020-10-24 09:24:47 -0700 | [diff] [blame] | 2238 | <https://fmt.dev/latest/api.html#_CPPv2N3fmt16make_format_argsEDpRK4Args>`_ |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2239 | 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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2254 | (`#687 <https://github.com/fmtlib/fmt/issues/687>`_, |
| 2255 | `#694 <https://github.com/fmtlib/fmt/pull/694>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2256 | 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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2269 | types in ``fmt/ranges.h`` (`#735 <https://github.com/fmtlib/fmt/pull/735>`_): |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2270 | |
| 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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2280 | * Implemented ``wchar_t`` date and time formatting |
| 2281 | (`#712 <https://github.com/fmtlib/fmt/pull/712>`_): |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2282 | |
| 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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2292 | * Provided more wide string overloads |
| 2293 | (`#724 <https://github.com/fmtlib/fmt/pull/724>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2294 | 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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2300 | * Added support for ``std::experimental::string_view`` |
| 2301 | (`#607 <https://github.com/fmtlib/fmt/pull/607>`_): |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2302 | |
| 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 Zverovich | cd46511 | 2020-10-24 09:24:47 -0700 | [diff] [blame] | 2320 | <https://fmt.dev/latest/api.html#format-api>`_ with compile-time handling of |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2321 | format strings. |
| 2322 | |
| 2323 | * Disallowed formatting of multibyte strings into a wide character target |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2324 | (`#606 <https://github.com/fmtlib/fmt/pull/606>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2325 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2326 | * 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 Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2332 | 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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2340 | * Added debug postfix ``d`` to the ``fmt`` library name |
| 2341 | (`#636 <https://github.com/fmtlib/fmt/issues/636>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2342 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2343 | * Removed unnecessary ``fmt/`` prefix in includes |
| 2344 | (`#397 <https://github.com/fmtlib/fmt/pull/397>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2345 | 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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2351 | * Added qmake project file ``support/fmt.pro`` |
| 2352 | (`#641 <https://github.com/fmtlib/fmt/pull/641>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2353 | Thanks `@cowo78 (Giuseppe Corbelli) <https://github.com/cowo78>`_. |
| 2354 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2355 | * Added Gradle build file ``support/build.gradle`` |
| 2356 | (`#649 <https://github.com/fmtlib/fmt/pull/649>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2357 | Thanks `@luncliff (Park DongHa) <https://github.com/luncliff>`_. |
| 2358 | |
| 2359 | * Removed ``FMT_CPPFORMAT`` CMake option. |
| 2360 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2361 | * Fixed a name conflict with the macro ``CHAR_WIDTH`` in glibc |
| 2362 | (`#616 <https://github.com/fmtlib/fmt/pull/616>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2363 | Thanks `@aroig (AbdĂł Roig-Maranges) <https://github.com/aroig>`_. |
| 2364 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2365 | * Fixed handling of nested braces in ``fmt::join`` |
| 2366 | (`#638 <https://github.com/fmtlib/fmt/issues/638>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2367 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2368 | * Added ``SOURCELINK_SUFFIX`` for compatibility with Sphinx 1.5 |
| 2369 | (`#497 <https://github.com/fmtlib/fmt/pull/497>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2370 | Thanks `@ginggs (Graham Inggs) <https://github.com/ginggs>`_. |
| 2371 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2372 | * Added a missing ``inline`` in the header-only mode |
| 2373 | (`#626 <https://github.com/fmtlib/fmt/pull/626>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2374 | Thanks `@aroig (AbdĂł Roig-Maranges) <https://github.com/aroig>`_. |
| 2375 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2376 | * 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 Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2389 | 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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2393 | `@christianparpart (Christian Parpart) <https://github.com/christianparpart>`_, |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2394 | `@DanielaE (Daniela Engert) <https://github.com/DanielaE>`_, |
| 2395 | and `@mwinterb <https://github.com/mwinterb>`_. |
| 2396 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2397 | * Worked around an MSVC bug and fixed several warnings |
| 2398 | (`#653 <https://github.com/fmtlib/fmt/pull/653>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2399 | Thanks `@alabuzhev (Alex Alabuzhev) <https://github.com/alabuzhev>`_. |
| 2400 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2401 | * Worked around GCC bug 67371 |
| 2402 | (`#682 <https://github.com/fmtlib/fmt/issues/682>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2403 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2404 | * Fixed compilation with ``-fno-exceptions`` |
| 2405 | (`#655 <https://github.com/fmtlib/fmt/pull/655>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2406 | Thanks `@chenxiaolong (Andrew Gunnerson) <https://github.com/chenxiaolong>`_. |
| 2407 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2408 | * Made ``constexpr remove_prefix`` gcc version check tighter |
| 2409 | (`#648 <https://github.com/fmtlib/fmt/issues/648>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2410 | |
| 2411 | * Renamed internal type enum constants to prevent collision with poorly written |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2412 | C libraries (`#644 <https://github.com/fmtlib/fmt/issues/644>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2413 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2414 | * Added detection of ``wostream operator<<`` |
| 2415 | (`#650 <https://github.com/fmtlib/fmt/issues/650>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2416 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2417 | * Fixed compilation on OpenBSD |
| 2418 | (`#660 <https://github.com/fmtlib/fmt/pull/660>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2419 | Thanks `@hubslave <https://github.com/hubslave>`_. |
| 2420 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2421 | * Fixed compilation on FreeBSD 12 |
| 2422 | (`#732 <https://github.com/fmtlib/fmt/pull/732>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2423 | Thanks `@dankm <https://github.com/dankm>`_. |
| 2424 | |
| 2425 | * Fixed compilation when there is a mismatch between ``-std`` options between |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2426 | the library and user code |
| 2427 | (`#664 <https://github.com/fmtlib/fmt/issues/664>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2428 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2429 | * Fixed compilation with GCC 7 and ``-std=c++11`` |
| 2430 | (`#734 <https://github.com/fmtlib/fmt/issues/734>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2431 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2432 | * Improved generated binary code on GCC 7 and older |
| 2433 | (`#668 <https://github.com/fmtlib/fmt/issues/668>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2434 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2435 | * Fixed handling of numeric alignment with no width |
| 2436 | (`#675 <https://github.com/fmtlib/fmt/issues/675>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2437 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2438 | * Fixed handling of empty strings in UTF8/16 converters |
| 2439 | (`#676 <https://github.com/fmtlib/fmt/pull/676>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2440 | Thanks `@vgalka-sl (Vasili Galka) <https://github.com/vgalka-sl>`_. |
| 2441 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2442 | * Fixed formatting of an empty ``string_view`` |
| 2443 | (`#689 <https://github.com/fmtlib/fmt/issues/689>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2444 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2445 | * Fixed detection of ``string_view`` on libc++ |
| 2446 | (`#686 <https://github.com/fmtlib/fmt/issues/686>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2447 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2448 | * Fixed DLL issues (`#696 <https://github.com/fmtlib/fmt/pull/696>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2449 | Thanks `@sebkoenig <https://github.com/sebkoenig>`_. |
| 2450 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2451 | * Fixed compile checks for mixing narrow and wide strings |
| 2452 | (`#690 <https://github.com/fmtlib/fmt/issues/690>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2453 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2454 | * Disabled unsafe implicit conversion to ``std::string`` |
| 2455 | (`#729 <https://github.com/fmtlib/fmt/issues/729>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2456 | |
| 2457 | * Fixed handling of reused format specs (as in ``fmt::join``) for pointers |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2458 | (`#725 <https://github.com/fmtlib/fmt/pull/725>`_). |
| 2459 | Thanks `@mwinterb <https://github.com/mwinterb>`_. |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2460 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2461 | * Fixed installation of ``fmt/ranges.h`` |
| 2462 | (`#738 <https://github.com/fmtlib/fmt/pull/738>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2463 | Thanks `@sv1990 <https://github.com/sv1990>`_. |
| 2464 | |
| 2465 | 4.1.0 - 2017-12-20 |
| 2466 | ------------------ |
| 2467 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2468 | * Added ``fmt::to_wstring()`` in addition to ``fmt::to_string()`` |
| 2469 | (`#559 <https://github.com/fmtlib/fmt/pull/559>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2470 | Thanks `@alabuzhev (Alex Alabuzhev) <https://github.com/alabuzhev>`_. |
| 2471 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2472 | * 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 Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2475 | Thanks `@thelostt (MĂĄrio Feroldi) <https://github.com/thelostt>`_ and |
| 2476 | `@mwinterb <https://github.com/mwinterb>`_. |
| 2477 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2478 | * Enabled stream exceptions to catch errors |
| 2479 | (`#581 <https://github.com/fmtlib/fmt/issues/581>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2480 | Thanks `@crusader-mike <https://github.com/crusader-mike>`_. |
| 2481 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2482 | * Allowed formatting of class hierarchies with ``fmt::format_arg()`` |
| 2483 | (`#547 <https://github.com/fmtlib/fmt/pull/547>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2484 | Thanks `@rollbear (Björn Fahller) <https://github.com/rollbear>`_. |
| 2485 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2486 | * Removed limitations on character types |
| 2487 | (`#563 <https://github.com/fmtlib/fmt/pull/563>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2488 | Thanks `@Yelnats321 (Elnar Dakeshov) <https://github.com/Yelnats321>`_. |
| 2489 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2490 | * Conditionally enabled use of ``std::allocator_traits`` |
| 2491 | (`#583 <https://github.com/fmtlib/fmt/pull/583>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2492 | Thanks `@mwinterb <https://github.com/mwinterb>`_. |
| 2493 | |
| 2494 | * Added support for ``const`` variadic member function emulation with |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2495 | ``FMT_VARIADIC_CONST`` (`#591 <https://github.com/fmtlib/fmt/pull/591>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2496 | Thanks `@ludekvodicka (Ludek Vodicka) <https://github.com/ludekvodicka>`_. |
| 2497 | |
| 2498 | * Various bugfixes: bad overflow check, unsupported implicit type conversion |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2499 | 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 Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2503 | Thanks `@xylosper (Byoung-young Lee) <https://github.com/xylosper>`_. |
| 2504 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2505 | * 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 Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2516 | 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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2527 | (`#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 Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2530 | Thanks `@mikecrowe (Mike Crowe) <https://github.com/mikecrowe>`_, |
| 2531 | `@evgen231 <https://github.com/evgen231>`_ and |
| 2532 | `@henryiii (Henry Schreiner) <https://github.com/henryiii>`_. |
| 2533 | |
| 2534 | 4.0.0 - 2017-06-27 |
| 2535 | ------------------ |
| 2536 | |
| 2537 | * Removed old compatibility headers ``cppformat/*.h`` and CMake options |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2538 | (`#527 <https://github.com/fmtlib/fmt/pull/527>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2539 | 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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2543 | (`#326 <https://github.com/fmtlib/fmt/issues/326>`_ and |
| 2544 | `#441 <https://github.com/fmtlib/fmt/pull/441>`_): |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2545 | |
| 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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2556 | 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 Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2563 | |
| 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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2574 | 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 Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2577 | |
| 2578 | * Added ``container.h`` containing a ``BasicContainerWriter`` |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2579 | to write to containers like ``std::vector`` |
| 2580 | (`#450 <https://github.com/fmtlib/fmt/pull/450>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2581 | Thanks `@polyvertex (Jean-Charles Lefebvre) <https://github.com/polyvertex>`_. |
| 2582 | |
| 2583 | * Added ``fmt::join()`` function that takes a range and formats |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2584 | its elements separated by a given string |
| 2585 | (`#466 <https://github.com/fmtlib/fmt/pull/466>`_): |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2586 | |
| 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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2598 | of built-in formatting (`#444 <https://github.com/fmtlib/fmt/pull/444>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2599 | Thanks `@polyvertex (Jean-Charles Lefebvre) <https://github.com/polyvertex>`_. |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2600 | See also `#439 <https://github.com/fmtlib/fmt/issues/439>`_. |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2601 | |
| 2602 | * Added ``fmt::format_system_error()`` for error code formatting |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2603 | (`#323 <https://github.com/fmtlib/fmt/issues/323>`_ and |
| 2604 | `#526 <https://github.com/fmtlib/fmt/pull/526>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2605 | Thanks `@maddinat0r (Alex Martin) <https://github.com/maddinat0r>`_. |
| 2606 | |
| 2607 | * Added thread-safe ``fmt::localtime()`` and ``fmt::gmtime()`` |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2608 | as replacement for the standard version to ``time.h`` |
| 2609 | (`#396 <https://github.com/fmtlib/fmt/pull/396>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2610 | Thanks `@codicodi <https://github.com/codicodi>`_. |
| 2611 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2612 | * 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 Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2615 | Thanks `@chronoxor <https://github.com/chronoxor>`_. |
| 2616 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2617 | * 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 Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2622 | |
| 2623 | * Fixed handling of wide strings in ``fmt::StringWriter``. |
| 2624 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2625 | * Improved compiler error messages |
| 2626 | (`#357 <https://github.com/fmtlib/fmt/issues/357>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2627 | |
| 2628 | * Fixed various warnings and issues with various compilers |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2629 | (`#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 Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2637 | 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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2643 | * 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 Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2651 | 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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2657 | `@pwm1234 (Phil) <https://github.com/pwm1234>`_ for |
| 2658 | `#393 <https://github.com/fmtlib/fmt/pull/393>`_. |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2659 | |
| 2660 | 3.0.2 - 2017-06-14 |
| 2661 | ------------------ |
| 2662 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2663 | * Added ``FMT_VERSION`` macro |
| 2664 | (`#411 <https://github.com/fmtlib/fmt/issues/411>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2665 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2666 | * Used ``FMT_NULL`` instead of literal ``0`` |
| 2667 | (`#409 <https://github.com/fmtlib/fmt/pull/409>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2668 | Thanks `@alabuzhev (Alex Alabuzhev) <https://github.com/alabuzhev>`_. |
| 2669 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2670 | * Added extern templates for ``format_float`` |
| 2671 | (`#413 <https://github.com/fmtlib/fmt/issues/413>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2672 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2673 | * Fixed implicit conversion issue |
| 2674 | (`#507 <https://github.com/fmtlib/fmt/issues/507>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2675 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2676 | * Fixed signbit detection (`#423 <https://github.com/fmtlib/fmt/issues/423>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2677 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2678 | * Fixed naming collision (`#425 <https://github.com/fmtlib/fmt/issues/425>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2679 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2680 | * Fixed missing intrinsic for C++/CLI |
| 2681 | (`#457 <https://github.com/fmtlib/fmt/pull/457>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2682 | Thanks `@calumr (Calum Robinson) <https://github.com/calumr>`_ |
| 2683 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2684 | * Fixed Android detection (`#458 <https://github.com/fmtlib/fmt/pull/458>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2685 | Thanks `@Gachapen (Magnus Bjerke Vik) <https://github.com/Gachapen>`_. |
| 2686 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2687 | * Use lean ``windows.h`` if not in header-only mode |
| 2688 | (`#503 <https://github.com/fmtlib/fmt/pull/503>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2689 | Thanks `@Quentin01 (Quentin Buathier) <https://github.com/Quentin01>`_. |
| 2690 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2691 | * Fixed issue with CMake exporting C++11 flag |
| 2692 | (`#445 <https://github.com/fmtlib/fmt/pull/455>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2693 | Thanks `@EricWF (Eric) <https://github.com/EricWF>`_. |
| 2694 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2695 | * Fixed issue with nvcc and MSVC compiler bug and MinGW |
| 2696 | (`#505 <https://github.com/fmtlib/fmt/issues/505>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2697 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2698 | * Fixed DLL issues (`#469 <https://github.com/fmtlib/fmt/pull/469>`_ and |
| 2699 | `#502 <https://github.com/fmtlib/fmt/pull/502>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2700 | Thanks `@richardeakin (Richard Eakin) <https://github.com/richardeakin>`_ and |
| 2701 | `@AndreasSchoenle (Andreas Schönle) <https://github.com/AndreasSchoenle>`_. |
| 2702 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2703 | * Fixed test compilation under FreeBSD |
| 2704 | (`#433 <https://github.com/fmtlib/fmt/issues/433>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2705 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2706 | * 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 Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2709 | Thanks `@Lecetem <https://github.com/Lectem>`_, |
| 2710 | `@chenhayat (Chen Hayat) <https://github.com/chenhayat>`_ and |
| 2711 | `@trozen <https://github.com/trozen>`_. |
| 2712 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2713 | * Worked around a broken ``__builtin_clz`` in clang with MS codegen |
| 2714 | (`#519 <https://github.com/fmtlib/fmt/issues/519>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2715 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2716 | * Removed redundant include |
| 2717 | (`#479 <https://github.com/fmtlib/fmt/issues/479>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2718 | |
| 2719 | * Fixed documentation issues. |
| 2720 | |
| 2721 | 3.0.1 - 2016-11-01 |
| 2722 | ------------------ |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2723 | * Fixed handling of thousands separator |
| 2724 | (`#353 <https://github.com/fmtlib/fmt/issues/353>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2725 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2726 | * Fixed handling of ``unsigned char`` strings |
| 2727 | (`#373 <https://github.com/fmtlib/fmt/issues/373>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2728 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2729 | * Corrected buffer growth when formatting time |
| 2730 | (`#367 <https://github.com/fmtlib/fmt/issues/367>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2731 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2732 | * 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 Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2737 | Thanks `@jcelerier (Jean-Michaël Celerier) <https://github.com/jcelerier>`_ |
| 2738 | and `@nmoehrle (Nils Moehrle) <https://github.com/nmoehrle>`_. |
| 2739 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2740 | * 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 Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2752 | 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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2759 | (`#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 Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2763 | Thanks to `@smellman (Taro Matsuzawa aka. btm) |
| 2764 | <https://github.com/smellman>`_. |
| 2765 | |
| 2766 | 3.0.0 - 2016-05-07 |
| 2767 | ------------------ |
| 2768 | |
| 2769 | * The project has been renamed from C++ Format (cppformat) to fmt for |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2770 | consistency with the used namespace and macro prefix |
| 2771 | (`#307 <https://github.com/fmtlib/fmt/issues/307>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2772 | 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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2783 | * 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 Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2786 | |
| 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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2795 | * ``std::ostream`` support including formatting of user-defined types that provide |
| 2796 | overloaded ``operator<<`` has been moved to ``fmt/ostream.h``: |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2797 | |
| 2798 | .. code:: c++ |
| 2799 | |
| 2800 | #include "fmt/ostream.h" |
| 2801 | |
| 2802 | class Date { |
| 2803 | int year_, month_, day_; |
| 2804 | public: |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2805 | Date(int year, int month, int day) : year_(year), month_(month), day_(day) {} |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2806 | |
| 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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2816 | <https://fmt.dev/3.0.0/api.html#argument-formatters>`_ |
| 2817 | (`#235 <https://github.com/fmtlib/fmt/issues/235>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2818 | |
| 2819 | * Added support for locale-specific integer formatting with the ``n`` specifier |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2820 | (`#305 <https://github.com/fmtlib/fmt/issues/305>`_): |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2821 | |
| 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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2828 | format specifier (`#265 <https://github.com/fmtlib/fmt/issues/265>`_): |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2829 | |
| 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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2837 | functions and the correct type is determined automatically |
| 2838 | (`#255 <https://github.com/fmtlib/fmt/issues/255>`_): |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2839 | |
| 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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2846 | * Added initial support for custom formatters |
| 2847 | (`#231 <https://github.com/fmtlib/fmt/issues/231>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2848 | |
| 2849 | * Fixed detection of user-defined literal support on Intel C++ compiler |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2850 | (`#311 <https://github.com/fmtlib/fmt/issues/311>`_, |
| 2851 | `#312 <https://github.com/fmtlib/fmt/pull/312>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2852 | Thanks to `@dean0x7d (Dean Moldovan) <https://github.com/dean0x7d>`_ and |
| 2853 | `@speth (Ray Speth) <https://github.com/speth>`_. |
| 2854 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2855 | * 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 Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2859 | |
| 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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2868 | * Compile test fixes (`#313 <https://github.com/fmtlib/fmt/pull/313>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2869 | Thanks to `@dean0x7d (Dean Moldovan) <https://github.com/dean0x7d>`_. |
| 2870 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2871 | * 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 Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2878 | 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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2882 | * 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 Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2893 | Thanks to `@mwinterb <https://github.com/mwinterb>`_, |
| 2894 | `@pweiskircher (Patrik Weiskircher) <https://github.com/pweiskircher>`_, |
| 2895 | `@Naios <https://github.com/Naios>`_. |
| 2896 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2897 | * 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 Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2900 | Thanks to `@mwinterb <https://github.com/mwinterb>`_. |
| 2901 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2902 | * Added tests of compatibility with older C++ standards |
| 2903 | (`#273 <https://github.com/fmtlib/fmt/pull/273>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2904 | Thanks to `@niosHD <https://github.com/niosHD>`_. |
| 2905 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2906 | * Fixed Android build (`#271 <https://github.com/fmtlib/fmt/pull/271>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2907 | Thanks to `@newnon <https://github.com/newnon>`_. |
| 2908 | |
| 2909 | * Changed ``ArgMap`` to be backed by a vector instead of a map. |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2910 | (`#261 <https://github.com/fmtlib/fmt/issues/261>`_, |
| 2911 | `#262 <https://github.com/fmtlib/fmt/pull/262>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2912 | Thanks to `@mwinterb <https://github.com/mwinterb>`_. |
| 2913 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2914 | * 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 Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2917 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2918 | * Export symbols when building a Windows DLL |
| 2919 | (`#245 <https://github.com/fmtlib/fmt/pull/245>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2920 | Thanks to `macdems (Maciek Dems) <https://github.com/macdems>`_. |
| 2921 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2922 | * Fixed compilation on Cygwin (`#304 <https://github.com/fmtlib/fmt/issues/304>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2923 | |
| 2924 | * Implemented a workaround for a bug in Apple LLVM version 4.2 of clang |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2925 | (`#276 <https://github.com/fmtlib/fmt/issues/276>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2926 | |
| 2927 | * Implemented a workaround for Google Test bug |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2928 | `#705 <https://github.com/google/googletest/issues/705>`_ on gcc 6 |
| 2929 | (`#268 <https://github.com/fmtlib/fmt/issues/268>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2930 | Thanks to `octoploid <https://github.com/octoploid>`_. |
| 2931 | |
| 2932 | * Removed Biicode support because the latter has been discontinued. |
| 2933 | |
| 2934 | 2.1.1 - 2016-04-11 |
| 2935 | ------------------ |
| 2936 | |
| 2937 | * The install location for generated CMake files is now configurable via |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2938 | the ``FMT_CMAKE_DIR`` CMake variable |
| 2939 | (`#299 <https://github.com/fmtlib/fmt/pull/299>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2940 | Thanks to `@niosHD <https://github.com/niosHD>`_. |
| 2941 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2942 | * Documentation fixes (`#252 <https://github.com/fmtlib/fmt/issues/252>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2943 | |
| 2944 | 2.1.0 - 2016-03-21 |
| 2945 | ------------------ |
| 2946 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2947 | * Project layout and build system improvements |
| 2948 | (`#267 <https://github.com/fmtlib/fmt/pull/267>`_): |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2949 | |
| 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 | |
| 2966 | 2.0.1 - 2016-03-13 |
| 2967 | ------------------ |
| 2968 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2969 | * Improved CMake find and package support |
| 2970 | (`#264 <https://github.com/fmtlib/fmt/issues/264>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2971 | Thanks to `@niosHD <https://github.com/niosHD>`_. |
| 2972 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2973 | * Fix compile error with Android NDK and mingw32 |
| 2974 | (`#241 <https://github.com/fmtlib/fmt/issues/241>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2975 | Thanks to `@Gachapen (Magnus Bjerke Vik) <https://github.com/Gachapen>`_. |
| 2976 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2977 | * Documentation fixes |
| 2978 | (`#248 <https://github.com/fmtlib/fmt/issues/248>`_, |
| 2979 | `#260 <https://github.com/fmtlib/fmt/issues/260>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2980 | |
| 2981 | 2.0.0 - 2015-12-01 |
| 2982 | ------------------ |
| 2983 | |
| 2984 | General |
| 2985 | ~~~~~~~ |
| 2986 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2987 | * [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 Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 2991 | |
| 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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 2999 | (`#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 Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 3002 | |
| 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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 3011 | variadic templates |
| 3012 | (`#141 <https://github.com/fmtlib/fmt/issues/141>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 3013 | Thanks to `@Shauren <https://github.com/Shauren>`_. |
| 3014 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 3015 | * Runtime width specification |
| 3016 | (`#168 <https://github.com/fmtlib/fmt/pull/168>`_): |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 3017 | |
| 3018 | .. code:: c++ |
| 3019 | |
| 3020 | fmt::format("{0:{1}}", 42, 5); // gives " 42" |
| 3021 | |
| 3022 | Thanks to `@jamboree <https://github.com/jamboree>`_. |
| 3023 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 3024 | * [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 Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 3027 | |
| 3028 | * [Breaking] Changed default ``bool`` format to textual, "true" or "false" |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 3029 | (`#170 <https://github.com/fmtlib/fmt/issues/170>`_): |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 3030 | |
| 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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 3041 | * ``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 Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 3044 | |
| 3045 | .. code:: c++ |
| 3046 | |
| 3047 | fmt::printf("%s", true); // prints "true" |
| 3048 | |
| 3049 | Thanks to `@LarsGullik <https://github.com/LarsGullik>`_. |
| 3050 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 3051 | * [Breaking] ``signed char`` and ``unsigned char`` are now formatted as integers by default |
| 3052 | (`#217 <https://github.com/fmtlib/fmt/pull/217>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 3053 | |
| 3054 | * [Breaking] Pointers to C strings can now be formatted with the ``p`` specifier |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 3055 | (`#223 <https://github.com/fmtlib/fmt/pull/223>`_): |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 3056 | |
| 3057 | .. code:: c++ |
| 3058 | |
| 3059 | fmt::print("{:p}", "test"); // prints pointer value |
| 3060 | |
| 3061 | Thanks to `@LarsGullik <https://github.com/LarsGullik>`_. |
| 3062 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 3063 | * [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 Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 3066 | Thanks to `@LarsGullik <https://github.com/LarsGullik>`_. |
| 3067 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 3068 | * [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 Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 3071 | |
| 3072 | .. code:: c++ |
| 3073 | |
| 3074 | fmt::printf("The date is %s", Date(2012, 12, 9)); |
| 3075 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 3076 | * [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 Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 3080 | |
| 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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 3084 | (`#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 Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 3087 | |
| 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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 3095 | * Dependency on pthreads introduced by Google Test is now optional |
| 3096 | (`#185 <https://github.com/fmtlib/fmt/issues/185>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 3097 | |
| 3098 | * New CMake options ``FMT_DOC``, ``FMT_INSTALL`` and ``FMT_TEST`` to control |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 3099 | 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 Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 3103 | Thanks to `@maddinat0r (Alex Martin) <https://github.com/maddinat0r>`_. |
| 3104 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 3105 | * ``noexcept`` is now used when compiling with MSVC2015 |
| 3106 | (`#215 <https://github.com/fmtlib/fmt/pull/215>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 3107 | 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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 3110 | is defined as 0 before including ``format.h`` |
| 3111 | (`#171 <https://github.com/fmtlib/fmt/issues/171>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 3112 | 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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 3117 | (`#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 Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 3120 | Thanks to `@DevO2012 <https://github.com/DevO2012>`_. |
| 3121 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 3122 | * Improved support for custom character types |
| 3123 | (`#171 <https://github.com/fmtlib/fmt/issues/171>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 3124 | 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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 3127 | 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 Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 3130 | Thanks to `@JodiTheTigger <https://github.com/JodiTheTigger>`_. |
| 3131 | |
| 3132 | * Improved detection of ``isnan``, ``isinf`` and ``signbit``. |
| 3133 | |
| 3134 | Optimization |
| 3135 | ~~~~~~~~~~~~ |
| 3136 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 3137 | * 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 Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 3140 | 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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 3144 | on Karma's benchmark |
| 3145 | (`#186 <https://github.com/fmtlib/fmt/issues/186>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 3146 | |
| 3147 | * [Breaking] Reduced `compiled code size |
| 3148 | <https://github.com/fmtlib/fmt#compile-time-and-code-bloat>`_ |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 3149 | (`#143 <https://github.com/fmtlib/fmt/issues/143>`_, |
| 3150 | `#149 <https://github.com/fmtlib/fmt/pull/149>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 3151 | |
| 3152 | Distribution |
| 3153 | ~~~~~~~~~~~~ |
| 3154 | |
| 3155 | * [Breaking] Headers are now installed in |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 3156 | ``${CMAKE_INSTALL_PREFIX}/include/cppformat`` |
| 3157 | (`#178 <https://github.com/fmtlib/fmt/issues/178>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 3158 | 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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 3162 | (`#178 <https://github.com/fmtlib/fmt/issues/178>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 3163 | 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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 3170 | (`#155 <https://github.com/fmtlib/fmt/issues/155>`_):: |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 3171 | |
| 3172 | $ sudo apt-get install libcppformat1-dev |
| 3173 | |
| 3174 | Thanks to `@jackyf (Eugene V. Lyubimkin) <https://github.com/jackyf>`_. |
| 3175 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 3176 | * `Packages for Fedora and RHEL <https://admin.fedoraproject.org/pkgdb/package/cppformat/>`_ |
| 3177 | are now available. Thanks to Dave Johansen. |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 3178 | |
| 3179 | * C++ Format can now be installed via `Homebrew <http://brew.sh/>`_ on OS X |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 3180 | (`#157 <https://github.com/fmtlib/fmt/issues/157>`_):: |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 3181 | |
| 3182 | $ brew install cppformat |
| 3183 | |
| 3184 | Thanks to `@ortho <https://github.com/ortho>`_, Anatoliy Bulukin. |
| 3185 | |
| 3186 | Documentation |
| 3187 | ~~~~~~~~~~~~~ |
| 3188 | |
| 3189 | * Migrated from ReadTheDocs to GitHub Pages for better responsiveness |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 3190 | and reliability |
| 3191 | (`#128 <https://github.com/fmtlib/fmt/issues/128>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 3192 | 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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 3199 | * 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 Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 3202 | Thanks to `@JodiTheTigger <https://github.com/JodiTheTigger>`_ and |
| 3203 | `@xentec <https://github.com/xentec>`_. |
| 3204 | |
| 3205 | * Documentation fixes and improvements |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 3206 | (`#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 Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 3214 | Thanks to `@syohex (Syohei YOSHIDA) <https://github.com/syohex>`_ and |
| 3215 | bug reporters. |
| 3216 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 3217 | * Fixed out-of-tree documentation build |
| 3218 | (`#177 <https://github.com/fmtlib/fmt/issues/177>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 3219 | Thanks to `@jackyf (Eugene V. Lyubimkin) <https://github.com/jackyf>`_. |
| 3220 | |
| 3221 | Fixes |
| 3222 | ~~~~~ |
| 3223 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 3224 | * Fixed ``initializer_list`` detection |
| 3225 | (`#136 <https://github.com/fmtlib/fmt/issues/136>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 3226 | Thanks to `@Gachapen (Magnus Bjerke Vik) <https://github.com/Gachapen>`_. |
| 3227 | |
| 3228 | * [Breaking] Fixed formatting of enums with numeric format specifiers in |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 3229 | ``fmt::(s)printf`` |
| 3230 | (`#131 <https://github.com/fmtlib/fmt/issues/131>`_, |
| 3231 | `#139 <https://github.com/fmtlib/fmt/issues/139>`_): |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 3232 | |
| 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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 3241 | (`#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 Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 3244 | Thanks to `@cstamford (Christopher Stamford) <https://github.com/cstamford>`_. |
| 3245 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 3246 | * Fixed a compile error on MSVC with disabled exceptions |
| 3247 | (`#144 <https://github.com/fmtlib/fmt/issues/144>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 3248 | |
| 3249 | * Added a workaround for broken implementation of variadic templates in MSVC2012 |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 3250 | (`#148 <https://github.com/fmtlib/fmt/issues/148>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 3251 | |
| 3252 | * Placed the anonymous namespace within ``fmt`` namespace for the header-only |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 3253 | configuration |
| 3254 | (`#171 <https://github.com/fmtlib/fmt/issues/171>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 3255 | Thanks to `@alfps (Alf P. Steinbach) <https://github.com/alfps>`_. |
| 3256 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 3257 | * 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 Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 3260 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 3261 | * Implemented a workaround for a name lookup bug in MSVC2010 |
| 3262 | (`#188 <https://github.com/fmtlib/fmt/issues/188>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 3263 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 3264 | * 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 Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 3289 | `@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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 3302 | * 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 Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 3310 | Thanks to `@Naios <https://github.com/Naios>`_, |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 3311 | `@jackyf (Eugene V. Lyubimkin) <https://github.com/jackyf>`_ and Dave Johansen. |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 3312 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 3313 | * 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 Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 3316 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 3317 | * Fixed shared library build on OS X |
| 3318 | (`#212 <https://github.com/fmtlib/fmt/pull/212>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 3319 | 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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 3322 | (`#214 <https://github.com/fmtlib/fmt/pull/214>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 3323 | Thanks to `@slavanap (Vyacheslav Napadovsky) <https://github.com/slavanap>`_. |
| 3324 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 3325 | * Improved compatibility with MSVC 2008 |
| 3326 | (`#236 <https://github.com/fmtlib/fmt/pull/236>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 3327 | Thanks to `@Jopie64 (Johan) <https://github.com/Jopie64>`_. |
| 3328 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 3329 | * Improved compatibility with bcc32 |
| 3330 | (`#227 <https://github.com/fmtlib/fmt/issues/227>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 3331 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 3332 | * Fixed ``static_assert`` detection on Clang |
| 3333 | (`#228 <https://github.com/fmtlib/fmt/pull/228>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 3334 | Thanks to `@dean0x7d (Dean Moldovan) <https://github.com/dean0x7d>`_. |
| 3335 | |
| 3336 | 1.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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 3341 | (`#105 <https://github.com/fmtlib/fmt/issues/105>`_ and |
| 3342 | `#122 <https://github.com/fmtlib/fmt/issues/122>`_): |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 3343 | |
| 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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 3354 | (`#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 Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 3358 | 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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 3362 | * CMake install target (`#119 <https://github.com/fmtlib/fmt/pull/119>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 3363 | 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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 3368 | (`#98 <https://github.com/fmtlib/fmt/pull/98>`_ and |
| 3369 | `#104 <https://github.com/fmtlib/fmt/pull/104>`_). Thanks to |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 3370 | `@MariadeAnton <https://github.com/MariadeAnton>`_ and |
| 3371 | `@franramirez688 <https://github.com/franramirez688>`_. |
| 3372 | |
| 3373 | * Improved support for building with `Android NDK |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 3374 | <https://developer.android.com/tools/sdk/ndk/index.html>`_ |
| 3375 | (`#107 <https://github.com/fmtlib/fmt/pull/107>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 3376 | 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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 3384 | * Improved documentation of ``SystemError`` and ``WindowsError`` |
| 3385 | (`#54 <https://github.com/fmtlib/fmt/issues/54>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 3386 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 3387 | * 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 Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 3391 | Thanks to `@CarterLi <https://github.com/CarterLi>`_. |
| 3392 | |
| 3393 | * Improved compile-time errors when formatting wide into narrow strings |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 3394 | (`#117 <https://github.com/fmtlib/fmt/issues/117>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 3395 | |
| 3396 | * Fixed ``BasicWriter::write`` without formatting arguments when C++11 support |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 3397 | is disabled (`#109 <https://github.com/fmtlib/fmt/issues/109>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 3398 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 3399 | * Fixed header-only build on OS X with GCC 4.9 |
| 3400 | (`#124 <https://github.com/fmtlib/fmt/issues/124>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 3401 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 3402 | * Fixed packaging issues (`#94 <https://github.com/fmtlib/fmt/issues/94>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 3403 | |
| 3404 | * Added `changelog <https://github.com/fmtlib/fmt/blob/master/ChangeLog.rst>`_ |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 3405 | (`#103 <https://github.com/fmtlib/fmt/issues/103>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 3406 | |
| 3407 | 1.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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 3420 | (`#79 <https://github.com/fmtlib/fmt/issues/79>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 3421 | 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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 3425 | (`#86 <https://github.com/fmtlib/fmt/issues/86>`_): |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 3426 | |
| 3427 | .. code:: c++ |
| 3428 | |
| 3429 | fmt::format(L"The date is {0}", Date(2012, 12, 9)); |
| 3430 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 3431 | * Fix linkage of tests on Arch Linux |
| 3432 | (`#89 <https://github.com/fmtlib/fmt/issues/89>`_). |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 3433 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 3434 | * Allow precision specifier for non-float arguments |
| 3435 | (`#90 <https://github.com/fmtlib/fmt/issues/90>`_): |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 3436 | |
| 3437 | .. code:: c++ |
| 3438 | |
| 3439 | fmt::print("{:.3}\n", "Carpet"); // prints "Car" |
| 3440 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 3441 | * Fix build on Android NDK |
| 3442 | (`#93 <https://github.com/fmtlib/fmt/issues/93>`_) |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 3443 | |
| 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 | |
| 3453 | 0.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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 3482 | * Support for custom memory allocators |
| 3483 | (`#69 <https://github.com/fmtlib/fmt/issues/69>`_) |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 3484 | |
| 3485 | * Formatting functions now accept `signed char` and `unsigned char` strings as |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 3486 | arguments (`#73 <https://github.com/fmtlib/fmt/issues/73>`_): |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 3487 | |
| 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 | |
| 3512 | 0.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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 3522 | * Arguments of ``char`` type can now be formatted as integers |
| 3523 | (Issue `#55 <https://github.com/fmtlib/fmt/issues/55>`_): |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 3524 | |
| 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 | |
| 3534 | 0.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 Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 3592 | Issue `#50 <https://github.com/fmtlib/fmt/issues/50>`_. |
Victor Zverovich | d30bca6 | 2020-07-04 17:43:30 -0700 | [diff] [blame] | 3593 | |
| 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 | |
| 3616 | 0.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 | |
| 3662 | 0.8.0 - 2014-04-14 |
| 3663 | ------------------ |
| 3664 | |
Victor Zverovich | 372175c | 2020-07-05 06:06:29 -0700 | [diff] [blame] | 3665 | * Initial release |