From 84e5170c9c023ed540d418a28d664e7e81abd991 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Mon, 24 Dec 2018 10:02:41 -0800 Subject: [PATCH] Update changelog and deprecate visit --- ChangeLog.rst | 51 ++++++++++++++++++++++++++++++++++------------ include/fmt/core.h | 3 ++- 2 files changed, 40 insertions(+), 14 deletions(-) diff --git a/ChangeLog.rst b/ChangeLog.rst index 998ae647..367aa6d8 100644 --- a/ChangeLog.rst +++ b/ChangeLog.rst @@ -1,25 +1,42 @@ -5.2.2 - TBD +5.3.0 - TBD -* Parameterized and constrained formatting functions on the type of the format - string +* Parameterized formatting functions on the type of the format string (`#880 `_, - `#881 `_, - `#883 `_). An object of a type that - has an overloaded `to_string_view` returning `fmt::string_view` can be used - as a format string: + `#881 `_, + `#883 `_, + `#889 `_, + `#897 `_). + An object of a type that has an overloaded `to_string_view` returning + `fmt::string_view` can be used as a format string: .. code:: c++ namespace my_ns { - inline string_view to_string_view(const my_string &s) { - return { s.data(), s.length() }; + inline string_view to_string_view(const my_string& s) { + return {s.data(), s.length()}; } } - std::string message = fmt::format(my_string("The answer is {}"), 42); + std::string message = fmt::format(my_string("The answer is {}."), 42); Thanks `@DanielaE (Daniela Engert) `_. +* Made ``std::[experimental::]string_view`` work as a format string + (`#898 `_): + + .. code:: c++ + + auto message = fmt::format(std::string_view("The answer is {}."), 42); + + Thanks `@DanielaE (Daniela Engert) `_. + +* Added experimental Unicode support + (`#628 `_, + `#891 `_): + + using namespace fmt::literals; + auto s = fmt::format("{:*^5}"_u, "🤡"_u); // s == "**🤡**"_u + * Made colored print functions work with wide strings (`#867 `_): @@ -33,17 +50,25 @@ Thanks `@DanielaE (Daniela Engert) `_. +* Deprecated ``fmt::visit``. Use ``fmt::visit_format_arg`` instead. + * Reintroduced support for gcc 4.4. * Fixed compilation on platforms with exotic ``double`` (`#878 `_). -* Clarified that writing to ``memory_buffer`` appends - (`#877 `_). +* Improved documentation + (`#877 `_, + `#901 `_). + Thanks `@kookjr (Mathew Cucuzella) `_. + +* Fixed non-matching char types + (`#895 `_). + Thanks `@DanielaE (Daniela Engert) `_. * Fixed various compiler warnings and errors (`#882 `_, - `#886 `_). + `#886 `_). Thanks `@Luthaf (Guillaume Fraux) `_, `@stevenhoving (Steven Hoving) `_. diff --git a/include/fmt/core.h b/include/fmt/core.h index 33830eef..44ee912e 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -443,7 +443,7 @@ typedef basic_string_view wstring_view; namespace my_ns { inline string_view to_string_view(const my_string &s) { - return { s.data(), s.length() }; + return {s.data(), s.length()}; } } @@ -865,6 +865,7 @@ FMT_CONSTEXPR typename internal::result_of::type return vis(monostate()); } +// DEPRECATED! template FMT_CONSTEXPR typename internal::result_of::type visit(Visitor &&vis, const basic_format_arg &arg) {