From 8c2557710d531fc04b17239ba1994661a7dd9092 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Wed, 16 May 2018 07:58:43 -0700 Subject: [PATCH] Update docs and changelog --- ChangeLog.rst | 24 ++++++++++++++++++++++++ doc/api.rst | 2 ++ include/fmt/format.h | 11 +++++++++++ 3 files changed, 37 insertions(+) diff --git a/ChangeLog.rst b/ChangeLog.rst index 4e1356a3..982c1117 100644 --- a/ChangeLog.rst +++ b/ChangeLog.rst @@ -52,6 +52,17 @@ :12:45: error: expression '' is not a constant expression throw format_error("invalid specifier"); +* Added `iterator support + `_: + + .. code:: c++ + + #include + #include + + std::vector out; + fmt::format_to(std::back_inserter(out), "{}", 42); + * Improved compile times by reducing dependencies on standard headers and providing a lightweight `core API `_: @@ -94,6 +105,19 @@ in the format API and provided ``fmt::string_view`` which implements a subset of ``std::string_view`` API for pre-C++17 systems. +* Added support for ``std::experimental::string_view`` + (`#607 `_): + + .. code:: c++ + + #include + #include + + fmt::print("{}", std::experimental::string_view("foo")); + + Thanks `@virgiliofornazin (Virgilio Alexandre Fornazin) + `_. + * Allowed mixing named and automatic arguments: .. code:: c++ diff --git a/doc/api.rst b/doc/api.rst index b65a8fc6..2a380a16 100644 --- a/doc/api.rst +++ b/doc/api.rst @@ -151,6 +151,8 @@ The following user-defined literals are defined in ``fmt/format.h``. Utilities --------- +.. dosygenfunction:: fmt::formatted_size(string_view, const Args&...) + .. doxygenfunction:: fmt::to_string(const T&) .. doxygenfunction:: fmt::to_wstring(const T&) diff --git a/include/fmt/format.h b/include/fmt/format.h index 07c644aa..6e273e84 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -3450,6 +3450,17 @@ inline OutputIt vformat_to(OutputIt out, string_view format_str, return vformat_to>(range(out), format_str, args); } +/** + \rst + Formats arguments, writes the result to the output iterator ``out`` and returns + the iterator past the end of the output range. + + **Example**:: + + std::vector out; + fmt::format_to(std::back_inserter(out), "{}", 42); + \endrst + */ template inline OutputIt format_to(OutputIt out, string_view format_str, const Args & ... args) {