diff --git a/ChangeLog.rst b/ChangeLog.rst index e806936a..14d54684 100644 --- a/ChangeLog.rst +++ b/ChangeLog.rst @@ -3,8 +3,18 @@ * Optimized format string parsing and argument processing +* Changed the ``fmt`` macro from opt-out to opt-in to prevent name collisions. + To enable it define the ``FMT_STRING_ALIAS`` macro to 1 before including + ``fmt/format.h``: + + .. code:: c++ + + #define FMT_STRING_ALIAS 1 + #include + std::string answer = format(fmt("{}"), 42); + * Added compile-time format string checks to ``format_to`` overload that takes - ``fmt::memory_buffer`` (`#783 `_): + ``fmt::memory_buffer`` (`#783 `_): .. code:: c++ @@ -12,6 +22,9 @@ // Compile-time error: invalid type specifier. fmt::format_to(buf, fmt("{:d}"), "foo"); +* Moved experimental color support to ``fmt/color.h`` and enabled the + new API by default. The old API can be enabled by defining the + ``FMT_DEPRECATED_COLORS`` macro. * Added formatting support for types explicitly convertible to ``fmt::string_view``: @@ -26,12 +39,21 @@ In particular, this makes formatting function work with ``folly::StringPiece``. +* Implemented preliminary support for ``char*_t`` by replacing the ``format`` + function overloads with a single function template parameterized on the string + type. + * Added support for dynamic argument lists - (`#814 `_, + (`#814 `_, `#819 `_). Thanks `@MikePopoloski (Michael Popoloski) `_. +* Reduced executable size overhead for embedded targets using newlib nano by + making locale dependency optional + (`#839 `_). + Thanks `@teajay-fr (Thomas Benard) `_. + * Keep ``noexcept`` specifier when exceptions are disabled (`#801 `_, `#810 `_). @@ -56,8 +78,19 @@ * Fixed various compiler warnings and errors (`#804 `_, `#809 `_, - `#811 `_). - Thanks `@henryiii (Henry Schreiner) `_. + `#811 `_, + `#822 `_, + `#827 `_, + `#830 `_, + `#838 `_, + `#843 `_, + `#844 `_, + `#851 `_, + `#852 `_, + `#854 `_). + Thanks `@henryiii (Henry Schreiner) `_, + `@medithe `_, and + `@eliasdaler (Elias Daler) `_. 5.1.0 - 2018-07-05 ------------------ diff --git a/README.rst b/README.rst index 771f0b63..422ac687 100644 --- a/README.rst +++ b/README.rst @@ -80,6 +80,7 @@ Format strings can be checked at compile time: .. code:: c++ // test.cc + #define FMT_STRING_ALIAS 1 #include std::string s = format(fmt("{2}"), 42); @@ -87,7 +88,7 @@ Format strings can be checked at compile time: $ c++ -Iinclude -std=c++14 test.cc ... - test.cc:3:17: note: in instantiation of function template specialization 'fmt::v5::format' requested here + test.cc:4:17: note: in instantiation of function template specialization 'fmt::v5::format' requested here std::string s = format(fmt("{2}"), 42); ^ include/fmt/core.h:778:19: note: non-constexpr function 'on_error' cannot be used in a constant expression diff --git a/include/fmt/format.h b/include/fmt/format.h index 705600c6..06ea33f2 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -2365,6 +2365,10 @@ class arg_formatter: explicit arg_formatter(context_type &ctx, format_specs *spec = {}) : base(Range(ctx.out()), spec), ctx_(ctx) {} + // Deprecated. + arg_formatter(context_type &ctx, format_specs &spec) + : base(Range(ctx.out()), &spec), ctx_(ctx) {} + using base::operator(); /** Formats an argument of a user-defined type. */