BloombergLP::bslfmt::format_to_n

Format args per fmtStr into out, writing at most maxNumChars characters.

Synopsis

Declared in <bslfmt_format_imp.h>

template<
    class t_OUT,
    class... t_ARGS>
format_to_n_result<t_OUT>
format_to_n(
    t_OUT out,
    bsl::iterator_traits<t_OUT>::difference_type maxNumChars,
    bslfmt::format_string<t_ARGS...> fmtStr,
    t_ARGS const&... args);

Description

Format the specified args according to the specification given by the specified fmtStr, and write at most the specified maxNumChars characters of the result of this operation into the output iterator referenced by the specified out parameter. Return a format_to_n_result object whose size member holds the number of characters that would have been written to out were such writing not truncated, and whose out member holds an iterator one past the end of the output range. In the event of an error the exception format_error is thrown. Behavior is undefined if out does not point to a valid output iterator.