[#BloombergLP-bslfmt-format-06]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslfmt.adoc[bslfmt]::format
:relfileprefix: ../../
:mrdocs:

Format the specified `args` according to the specification given by the specified `fmtStr`, using the specified `alloc` to supply memory (if required), and return the result&period; In the event of an error the exception `format&lowbar;error` is thrown&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class&period;&period;&period; t&lowbar;ARGS&gt;
xref:bsl/string.adoc[bsl::string]
format(
    xref:bsl/allocator-0df.adoc[bsl::allocator&lt;char&gt;] alloc,
    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);
----


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