diff --git a/doc/api.rst b/doc/api.rst index 263b4f72..de5604b4 100644 --- a/doc/api.rst +++ b/doc/api.rst @@ -22,7 +22,7 @@ arguments in the resulting string. *args* is an argument list representing objects to be formatted. -The `performance of the format API +The `performance of the formating functions `_ is close to that of glibc's ``printf`` and better than the performance of IOStreams. @@ -127,7 +127,7 @@ custom argument formatter class:: // with the ``x`` format specifier. class custom_arg_formatter : public arg_formatter { public: - custom_arg_formatter(context_type &ctx, fmt::format_specs &spec) + custom_arg_formatter(fmt::context &ctx, fmt::format_specs &spec) : arg_formatter(ctx, spec) {} using arg_formatter::operator(); @@ -142,8 +142,8 @@ custom argument formatter class:: std::string custom_vformat(fmt::string_view format_str, fmt::format_args args) { fmt::memory_buffer buffer; - // Pass custom argument formatter as a template arg to do_vformat. - fmt::do_vformat_to(buffer, format_str, args); + // Pass custom argument formatter as a template arg to vformat_to. + fmt::vformat_to(buffer, format_str, args); return fmt::to_string(buffer); } diff --git a/include/fmt/core.h b/include/fmt/core.h index 670fce2b..fe214cf0 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -183,9 +183,10 @@ typename std::add_rvalue_reference::type declval() FMT_NOEXCEPT; /** \rst An implementation of ``std::basic_string_view`` for pre-C++17. It provides a - subset of the API. fmt::basic_string_view is used for format strings even if - std::string_view is available to prevent issues when a library is compiled - with different -std option than the client code (which is not recommended). + subset of the API. ``fmt::basic_string_view`` is used for format strings even + if ``std::string_view`` is available to prevent issues when a library is + compiled with a different ``-std`` option than the client code (which is not + recommended). \endrst */ template diff --git a/include/fmt/format.h b/include/fmt/format.h index b388fdbe..5d3edd6f 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -3197,9 +3197,9 @@ struct format_handler : internal::error_handler { /** Formats arguments and writes the output to the buffer. */ template -typename Context::iterator do_vformat_to(typename ArgFormatter::range out, - basic_string_view format_str, - basic_format_args args) { +typename Context::iterator vformat_to(typename ArgFormatter::range out, + basic_string_view format_str, + basic_format_args args) { typedef internal::null_terminating_iterator iterator; format_handler h(out, format_str, args); parse_format_string(iterator(format_str.begin(), format_str.end()), h); @@ -3327,13 +3327,13 @@ std::basic_string to_string(const basic_memory_buffer &buffer) { inline void vformat_to(internal::buffer &buf, string_view format_str, format_args args) { typedef back_insert_range range; - do_vformat_to>(buf, format_str, args); + vformat_to>(buf, format_str, args); } inline void vformat_to(internal::wbuffer &buf, wstring_view format_str, wformat_args args) { typedef back_insert_range range; - do_vformat_to>(buf, format_str, args); + vformat_to>(buf, format_str, args); } template @@ -3362,7 +3362,7 @@ template inline OutputIt vformat_to(OutputIt out, string_view format_str, typename format_args_t::type args) { typedef output_range range; - return do_vformat_to>(range(out), format_str, args); + return vformat_to>(range(out), format_str, args); } template @@ -3465,7 +3465,7 @@ FMT_CONSTEXPR internal::udl_formatter operator""_format() { # else /** \rst - C++11 literal equivalent of :func:`fmt::format`. + User-defined literal equivalent of :func:`fmt::format`. **Example**:: @@ -3481,7 +3481,7 @@ operator"" _format(const wchar_t *s, std::size_t) { return {s}; } /** \rst - C++11 literal equivalent of :func:`fmt::arg`. + User-defined literal equivalent of :func:`fmt::arg`. **Example**:: diff --git a/test/custom-formatter-test.cc b/test/custom-formatter-test.cc index 59be29ca..8eda9154 100644 --- a/test/custom-formatter-test.cc +++ b/test/custom-formatter-test.cc @@ -37,7 +37,7 @@ class CustomArgFormatter : std::string custom_vformat(fmt::string_view format_str, fmt::format_args args) { fmt::memory_buffer buffer; // Pass custom argument formatter as a template arg to vwrite. - fmt::do_vformat_to(buffer, format_str, args); + fmt::vformat_to(buffer, format_str, args); return std::string(buffer.data(), buffer.size()); } diff --git a/test/format-test.cc b/test/format-test.cc index 801beea4..f118c8d6 100644 --- a/test/format-test.cc +++ b/test/format-test.cc @@ -1577,7 +1577,7 @@ class mock_arg_formatter: void custom_vformat(fmt::string_view format_str, fmt::format_args args) { fmt::memory_buffer buffer; - fmt::do_vformat_to(buffer, format_str, args); + fmt::vformat_to(buffer, format_str, args); } template