Document format_to_n
This commit is contained in:
parent
3cf0526316
commit
c5ebecf7c6
@ -135,6 +135,9 @@ Output iterator support
|
|||||||
-----------------------
|
-----------------------
|
||||||
|
|
||||||
.. doxygenfunction:: fmt::format_to(OutputIt, string_view, const Args&...)
|
.. doxygenfunction:: fmt::format_to(OutputIt, string_view, const Args&...)
|
||||||
|
.. doxygenfunction:: fmt::format_to_n(OutputIt, size_t string_view, const Args&...)
|
||||||
|
.. doxygenstruct:: fmt::format_to_n_result
|
||||||
|
:members:
|
||||||
|
|
||||||
Literal-based API
|
Literal-based API
|
||||||
-----------------
|
-----------------
|
||||||
|
@ -3256,7 +3256,7 @@ struct format_handler : internal::error_handler {
|
|||||||
basic_arg<Context> arg;
|
basic_arg<Context> arg;
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Formats arguments and writes the output to the buffer. */
|
/** Formats arguments and writes the output to the range. */
|
||||||
template <typename ArgFormatter, typename Char, typename Context>
|
template <typename ArgFormatter, typename Char, typename Context>
|
||||||
typename Context::iterator vformat_to(typename ArgFormatter::range out,
|
typename Context::iterator vformat_to(typename ArgFormatter::range out,
|
||||||
basic_string_view<Char> format_str,
|
basic_string_view<Char> format_str,
|
||||||
@ -3419,10 +3419,19 @@ inline typename std::enable_if<
|
|||||||
|
|
||||||
template <typename OutputIt>
|
template <typename OutputIt>
|
||||||
struct format_to_n_result {
|
struct format_to_n_result {
|
||||||
|
/** Iterator past the end of the output range. */
|
||||||
OutputIt out;
|
OutputIt out;
|
||||||
|
/** Total (not truncated) output size. */
|
||||||
std::size_t size;
|
std::size_t size;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
\rst
|
||||||
|
Formats arguments, writes up to ``n`` characters of the result to the output
|
||||||
|
iterator ``out`` and returns the total output size and the iterator past the end
|
||||||
|
of the output range.
|
||||||
|
\endrst
|
||||||
|
*/
|
||||||
template <typename OutputIt, typename... Args>
|
template <typename OutputIt, typename... Args>
|
||||||
inline format_to_n_result<OutputIt> format_to_n(
|
inline format_to_n_result<OutputIt> format_to_n(
|
||||||
OutputIt out, std::size_t n, string_view format_str, const Args & ... args) {
|
OutputIt out, std::size_t n, string_view format_str, const Args & ... args) {
|
||||||
|
Loading…
Reference in New Issue
Block a user