[#BloombergLP-bslfmt-format_to-0e]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslfmt.adoc[bslfmt]::format&lowbar;to
:relfileprefix: ../../
:mrdocs:

Format `args` per `fmtStr` into the output iterator `out`&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class t&lowbar;OUT,
    class&period;&period;&period; t&lowbar;ARGS&gt;
t&lowbar;OUT
format&lowbar;to(
    t&lowbar;OUT out,
    xref:BloombergLP/bslfmt/format_string.adoc[bslfmt::format&lowbar;string&lt;t&lowbar;ARGS&period;&period;&period;&gt;] fmtStr,
    t&lowbar;ARGS const&&period;&period;&period; args)
requires !bsl&colon;&colon;is&lowbar;same&lt;typename bsl&colon;&colon;decay&lt;t&lowbar;OUT&gt;&colon;&colon;type, bsl&colon;&colon;string &ast;&gt;&colon;&colon;value;
----

== Description

Format the specified `args` according to the specification given by the specified `fmtStr`, and write the result of this operation into the output iterator given by the specified `out` parameter&period; In the event of an error the exception `format&lowbar;error` is thrown&period; Behavior is undefined if `out` does not point to a valid output parameter&period;

== Return Value

output iterator after writing

== Parameters

[cols="1,4"]
|===
| Name| Description
| *out*
| output iterator receiving formatted characters
| *fmtStr*
| format string
| *args*
| values to format
|===


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