Format args per fmtStr into out using locale loc.

Synopsis

Declared in <bslfmt_format.h>

template<
    class t_STRING,
    class... t_ARGS>
requires (bsl::is_same_v<t_STRING, bsl::string>)
void
format_to(
    t_STRING* out,
    std::locale const& loc,
    format_string<t_ARGS...> fmtStr,
    t_ARGS&&... args);

Description

Format the specified args according to the specification given by the specified fmtStr in the locale of the specified loc, and write the result of this operation into the string addressed by the specified out parameter. In the event of an error throw the exception format_error. The behavior is undefined if out does not point to a valid bsl::string object. Note that this overload is provided in addition to the overloads in the standard library, and the requires clause is necessary to avoid ambiguity.

Parameters

Name

Description

out

address of the string receiving formatted characters

loc

locale used for locale‐dependent formatting

fmtStr

format string

args

values to format

Created with MrDocs