[#bsl-format-00]
= xref:bsl.adoc[bsl]::format
:relfileprefix: ../
:mrdocs:

`format` overloads

== Synopses

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

Format the specified `args` according to the specification given by the specified `fmtStr` and return the result as a `bsl&colon;&colon;string`&period; In the event of an error throw the exception `format&lowbar;error`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class&period;&period;&period; t&lowbar;ARGS&gt;
xref:bsl/string.adoc[bsl::string]
xref:bsl/format-07.adoc[format](
    format&lowbar;string&lt;t&lowbar;ARGS&period;&period;&period;&gt; fmtStr,
    t&lowbar;ARGS&&&period;&period;&period; args);
----

[.small]#xref:bsl/format-07.adoc[_» more&period;&period;&period;_]#

Format the specified `args` according to the specification given by the specified `fmtStr` and return the result&period; In the event of an error throw the exception `format&lowbar;error`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class&period;&period;&period; t&lowbar;ARGS&gt;
xref:bsl/wstring.adoc[bsl::wstring]
xref:bsl/format-05.adoc[format](
    wformat&lowbar;string&lt;t&lowbar;ARGS&period;&period;&period;&gt; fmtStr,
    t&lowbar;ARGS&&&period;&period;&period; args);
----

[.small]#xref:bsl/format-05.adoc[_» more&period;&period;&period;_]#

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 throw the exception `format&lowbar;error`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class&period;&period;&period; t&lowbar;ARGS&gt;
xref:bsl/string.adoc[bsl::string]
xref:bsl/format-0e.adoc[format](
    xref:bsl/allocator-0df.adoc[allocator&lt;char&gt;] alloc,
    format&lowbar;string&lt;t&lowbar;ARGS&period;&period;&period;&gt; fmtStr,
    t&lowbar;ARGS&&&period;&period;&period; args);
----

[.small]#xref:bsl/format-0e.adoc[_» more&period;&period;&period;_]#

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 throw the exception `format&lowbar;error`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class&period;&period;&period; t&lowbar;ARGS&gt;
xref:bsl/wstring.adoc[bsl::wstring]
xref:bsl/format-0ce.adoc[format](
    xref:bsl/allocator-0df.adoc[allocator&lt;wchar&lowbar;t&gt;] alloc,
    wformat&lowbar;string&lt;t&lowbar;ARGS&period;&period;&period;&gt; fmtStr,
    t&lowbar;ARGS&&&period;&period;&period; args);
----

[.small]#xref:bsl/format-0ce.adoc[_» more&period;&period;&period;_]#

Format the specified `args` according to the specification given by the specified `fmtStr` in the locale of the specified `loc` and return the result&period; In the event of an error throw the exception `format&lowbar;error`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class&period;&period;&period; t&lowbar;ARGS&gt;
xref:bsl/string.adoc[bsl::string]
xref:bsl/format-09.adoc[format](
    std::locale const& loc,
    format&lowbar;string&lt;t&lowbar;ARGS&period;&period;&period;&gt; fmtStr,
    t&lowbar;ARGS&&&period;&period;&period; args);
----

[.small]#xref:bsl/format-09.adoc[_» more&period;&period;&period;_]#

Format the specified `args` according to the specification given by the specified `fmtStr` in the locale of the specified `loc` and return the result&period; In the event of an error throw the exception `format&lowbar;error`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class&period;&period;&period; t&lowbar;ARGS&gt;
xref:bsl/wstring.adoc[bsl::wstring]
xref:bsl/format-0a.adoc[format](
    std::locale const& loc,
    wformat&lowbar;string&lt;t&lowbar;ARGS&period;&period;&period;&gt; fmtStr,
    t&lowbar;ARGS&&&period;&period;&period; args);
----

[.small]#xref:bsl/format-0a.adoc[_» more&period;&period;&period;_]#

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


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class&period;&period;&period; t&lowbar;ARGS&gt;
xref:bsl/string.adoc[bsl::string]
xref:bsl/format-0d.adoc[format](
    xref:bsl/allocator-0df.adoc[allocator&lt;char&gt;] alloc,
    std::locale const& loc,
    format&lowbar;string&lt;t&lowbar;ARGS&period;&period;&period;&gt; fmtStr,
    t&lowbar;ARGS&&&period;&period;&period; args);
----

[.small]#xref:bsl/format-0d.adoc[_» more&period;&period;&period;_]#

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


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class&period;&period;&period; t&lowbar;ARGS&gt;
xref:bsl/wstring.adoc[bsl::wstring]
xref:bsl/format-0cb.adoc[format](
    xref:bsl/allocator-0df.adoc[allocator&lt;wchar&lowbar;t&gt;] alloc,
    std::locale const& loc,
    wformat&lowbar;string&lt;t&lowbar;ARGS&period;&period;&period;&gt; fmtStr,
    t&lowbar;ARGS&&&period;&period;&period; args);
----

[.small]#xref:bsl/format-0cb.adoc[_» more&period;&period;&period;_]#


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