[#bsl-variant-2constructor-02d]
= xref:bsl.adoc[bsl]::xref:bsl/variant.adoc[variant]::variant
:relfileprefix: ../../
:mrdocs:

Create a `variant` object holding a contained value of type (template parameter) `t&lowbar;TYPE`, direct&hyphen;initialized from the specified `il` and `args`&period; If this `variant` is allocator&hyphen;aware, the specified &grave;allocator &grave;is used to supply memory&period; This constructor participates in overload resolutionly if `t&lowbar;TYPE` designates a unique alternative and is constructible from `il` and `args`&period;

== Synopsis

Declared in `&lt;bslstl&lowbar;variant&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class t&lowbar;TYPE,
    class INIT&lowbar;LIST&lowbar;TYPE,
    class&period;&period;&period; t&lowbar;ARGS&gt;
requires BSLSTL&lowbar;VARIANT&lowbar;HAS&lowbar;UNIQUE&lowbar;TYPE(t&lowbar;TYPE) &amp;&amp;
                  std&colon;&colon;is&lowbar;constructible&lt;t&lowbar;TYPE,
                                        std&colon;&colon;initializer&lowbar;list&lt;INIT&lowbar;LIST&lowbar;TYPE&gt;&amp;,
                                        t&lowbar;ARGS&period;&period;&period;&gt;&colon;&colon;value
explicit
variant(
    std::allocator&lowbar;arg&lowbar;t,
    xref:bsl/variant/allocator_type.adoc[allocator&lowbar;type] allocator,
    bsl::in&lowbar;place&lowbar;type&lowbar;t&lt;t&lowbar;TYPE&gt;,
    std::initializer&lowbar;list&lt;INIT&lowbar;LIST&lowbar;TYPE&gt; il,
    t&lowbar;ARGS&&&period;&period;&period; args);
----


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