[#bsl-format_to-086]
= xref:bsl.adoc[bsl]::format&lowbar;to
:relfileprefix: ../
:mrdocs:

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&period; In the event of an error thrwe the exception `format&lowbar;error`&period; The behavior is undefined if `out` does not point to a valid `bsl&colon;&colon;string` object&period; Note that this overload is provided in addition to the overloads in the standard library, and the requires clause is necessary to avoid ambiguity&period;

== Synopsis

Declared in `&lt;bslfmt&lowbar;format&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class t&lowbar;STRING,
    class&period;&period;&period; t&lowbar;ARGS&gt;
requires (bsl&colon;&colon;is&lowbar;same&lowbar;v&lt;t&lowbar;STRING, bsl&colon;&colon;string&gt;)
void
format&lowbar;to(
    t&lowbar;STRING* out,
    std::locale const& loc,
    format&lowbar;string&lt;t&lowbar;ARGS&period;&period;&period;&gt; fmtStr,
    t&lowbar;ARGS&&&period;&period;&period; args);
----


[.small]#Created with https://www.mrdocs.com[MrDocs]#
