From 3c0f8c2601f669a7e6aa90d0d82fc71ca1406a3e Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Sun, 13 May 2018 08:53:16 -0700 Subject: [PATCH] Update ChangeLog --- ChangeLog.rst | 152 ++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 123 insertions(+), 29 deletions(-) diff --git a/ChangeLog.rst b/ChangeLog.rst index 3db28ca8..5fa7b9c5 100644 --- a/ChangeLog.rst +++ b/ChangeLog.rst @@ -1,11 +1,58 @@ 5.0.0 - TBD ----------- -* Added a requirement for compiler support for variadic templates and dropped ``FMT_VARIADIC_*`` emulation macros. Variadic templates are available since GCC 4.4, Clang 2.9 and MSVC 18.0 (2013). For older compilers use `version 4.x `_ which continues to be maintained. +* Added a requirement for compiler support for variadic templates and dropped + ``FMT_VARIADIC_*`` emulation macros. Variadic templates are available since + GCC 4.4, Clang 2.9 and MSVC 18.0 (2013). For older compilers use `version 4.x + `_ which continues to be + maintained. -* Renamed symbols to follow standard C++ naming conventions and proposed a subset of the library for standardization in `P0645R2 Text Formatting `_. +* Renamed symbols to follow standard C++ naming conventions and proposed a subset + of the library for standardization in `P0645R2 Text Formatting + `_. -* Added the `make_format_args `_ function for capturing formatting arguments: +* Swparated format string parsing and formatting in the extension API to enable + compile-time format-string processing. For example + + .. code:: c++ + + struct S {}; + + namespace fmt { + template <> + struct formatter { + constexpr auto parse(parse_context& ctx) { + auto it = ctx.begin(); + spec = *it; + if (spec != 'd' && spec != 's') + throw format_error("invalid specifier"); + ++it; + return it; + } + + template + auto format(S, FormatContext& ctx) { + return spec == 's' ? + format_to(ctx.begin(), "{}", "fourty-two") : + format_to(ctx.begin(), "{}", 42); + } + + char spec = 0; + }; + } + + std::string s = fmt::format(fmt("{:x}"), S()); + + will give a compile-time error due to invalid format specifier (`godbolt + `_):: + + ... + :12:45: error: expression '' is not a constant expression + throw format_error("invalid specifier"); + +* Added the `make_format_args + `_ + function for capturing formatting arguments: .. code:: c++ @@ -19,7 +66,8 @@ vreport_error(format, fmt::make_format_args(args...)); } -* Added prefix ``v`` to non-variadic functions taking ``format_args`` to distinguish them from variadic ones: +* Added prefix ``v`` to non-variadic functions taking ``format_args`` to + distinguish them from variadic ones: .. code:: c++ @@ -28,67 +76,110 @@ template std::string format(string_view format_str, const Args & ... args); -* Added a section on `formatting user-defined types `_ to the docs (`#393 `_). Thanks `@pwm1234 (Phil) `_. +* Switched from a custom null-terminated string view class to ``string_view`` + in the format API and provided ``fmt::string_view`` which implements a subset + of ``std::string_view`` API for pre-C++17 systems. -* Added a section describing `the use of header-only target with CMake `_ to the docs (`#515 `_). Thanks `@ibell (Ian Bell) `_. +* Removed the write API in favor of the `format API + `_ with compile-time handling of + format strings. -* Removed the Write API in favor of the `Format API `_ with compile-time handling of format strings. +* Added a section on `formatting user-defined types + `_ to the docs + (`#393 `_). + Thanks `@pwm1234 (Phil) `_. -* Implemented thread-safe time formatting (`#395 `_, `#396 `_). +* Added a section describing `the use of header-only target with CMake + `_ to the docs + (`#515 `_). + Thanks `@ibell (Ian Bell) `_. + +* Implemented thread-safe time formatting ( + `#395 `_, + `#396 `_). Thanks `@codicodi `_. -* Added a version macro ``FMT_VERSION`` (`#411 `_). +* Implemented more efficient handling of large number of format arguments. -* Removed unnecessary ``fmt/`` prefix in includes (`#397 `_). +* Added a version macro ``FMT_VERSION`` + (`#411 `_). + +* Removed unnecessary ``fmt/`` prefix in includes + (`#397 `_). Thanks `@chronoxor (Ivan Shynkarenka) `_. -* Renamed ``CHAR_WIDTH`` to ``CHAR_SIZE`` to avoid collision with ISO/IEC TS 18661-1:2014 macro. +* Renamed ``CHAR_WIDTH`` to ``CHAR_SIZE`` to avoid collision with ISO/IEC TS + 18661-1:2014 macro. -* Replaced literal 0 with ``nullptr`` in pointer contexts (`#409 `_). +* Replaced literal 0 with ``nullptr`` in pointer contexts + (`#409 `_). Thanks `@alabuzhev (Alex Alabuzhev) `_. -* Added ``std::basic_string`` allocator support to ``fmt::string_view`` (`#441 `_). +* Added ``std::basic_string`` allocator support to ``fmt::string_view`` + (`#441 `_). Thanks `@glebov-andrey (Andrey Glebov) `_. -* Stopped exporting the ``-std=c++11`` flag from the ``fmt`` target (`#445 `_). +* Stopped exporting the ``-std=c++11`` flag from the ``fmt`` target + (`#445 `_). Thanks `@EricWF (Eric) `_. -* Made ``%s`` a generic format specifier that works with any argument type in ``fmt::printf`` (`#453 `_). +* Made ``%s`` a generic format specifier that works with any argument type in + ``fmt::printf`` (`#453 `_). Thanks `@mojoBrendan `_: .. code:: c++ fmt::printf("%s", 42); -* Placed CMake imported targets in the `fmt` namespace (`#511 `_, `#513 `_). - Thanks `@bjoernthiel (Bjoern Thiel) `_, `@niosHD (Mario Werner) `_. +* Placed CMake imported targets in the `fmt` namespace ( + `#511 `_, + `#513 `_). + Thanks `@bjoernthiel (Bjoern Thiel) `_ and + `@niosHD (Mario Werner) `_. -* Fixed minimal supported library subset (`#418 `_, `#419 `_, `#420 `_). +* Fixed minimal supported library subset ( + `#418 `_, + `#419 `_, + `#420 `_). Thanks `@alabuzhev (Alex Alabuzhev) `_. -* Fixed compilation on Android (`#381 `_). +* Fixed compilation on Android + (`#381 `_). Thanks `@hghwng (Hugh Wang) `_. -* Fixed compilation with ``-fno-exceptions`` (`#402 `_, `#405 `_). +* Fixed compilation with ``-fno-exceptions`` ( + `#402 `_, + `#405 `_). Thanks `@JanHellwig (Jan Hellwig) `_. -* Fixed compilation as a shared library with Clang (`#413 `_). Thanks `@foonathan (Jonathan Müller) `_. +* Fixed compilation as a shared library with Clang + (`#413 `_). + Thanks `@foonathan (Jonathan Müller) `_. -* Fixed test compilation on FreeBSD (`#433 `_). Thanks `@WscriChy `_. +* Fixed test compilation on FreeBSD + (`#433 `_). + Thanks `@WscriChy `_. -* Fixed a name conflict with Xlib (`#483 `_). +* Fixed a name conflict with Xlib + (`#483 `_). * Fixed signbit detection (`#423 `_). -* Fixed missing intrinsic when included from C++/CLI (`#457 `_). Thanks `@calumr (Calum Robinson) `_. +* Fixed missing intrinsic when included from C++/CLI + (`#457 `_). + Thanks `@calumr (Calum Robinson) `_. -* Fixed Android not being detected with NDK 13b toolchain (`#458 `_). Thanks `@Gachapen (Magnus Bjerke Vik) `_. +* Fixed Android not being detected with NDK 13b toolchain + (`#458 `_). + Thanks `@Gachapen (Magnus Bjerke Vik) `_. -* Added ``SOURCELINK_SUFFIX`` for compatibility with Sphinx 1.5 (`#497 `_). Thanks `@ginggs (Graham Inggs) `_. +* Added ``SOURCELINK_SUFFIX`` for compatibility with Sphinx 1.5 + (`#497 `_). + Thanks `@ginggs (Graham Inggs) `_. -* Added ``FMT_API`` declarations where needed for building a DLL (`#469 `_). Thanks `@richardeakin (Richard Eakin) `_. - -* Fixed various warnings (`#409 `_). Thanks `@Lectem `_, `@chenhayat (Chen Hayat) `_. +* Added ``FMT_API`` declarations where needed for building a DLL + (`#469 `_). + Thanks `@richardeakin (Richard Eakin) `_. 4.1.0 - 2017-12-20 ------------------ @@ -339,6 +430,9 @@ `@chenhayat (Chen Hayat) `_ and `@trozen `_. +* Worked around a broken ``__builtin_clz`` in clang with MS codegen + (`#519 `_). + * Removed redundant include (`#479 `_).