[#BloombergLP-bslstl-Variant_Base-2constructor-08d]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslstl.adoc[bslstl]::xref:BloombergLP/bslstl/Variant_Base.adoc[Variant&lowbar;Base]::Variant&lowbar;Base
:relfileprefix: ../../../
:mrdocs:

Constructors

== Synopses

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

Create a `Variant&lowbar;Base` object holding the 0th alternative, which is value&hyphen;initialized&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bslstl/Variant_Base/2constructor-00.adoc[Variant&lowbar;Base]();
----

[.small]#xref:BloombergLP/bslstl/Variant_Base/2constructor-00.adoc[_» more&period;&period;&period;_]#

Create a `Variant&lowbar;Base` object holding the same alternative (if any) as the specified `original` object&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bslstl/Variant_Base/2constructor-0f.adoc[Variant&lowbar;Base](xref:BloombergLP/bslstl/Variant_Base.adoc[Variant&lowbar;Base] const& original);
----

[.small]#xref:BloombergLP/bslstl/Variant_Base/2constructor-0f.adoc[_» more&period;&period;&period;_]#

Create a `Variant&lowbar;Base` object holding the same alternative (if any) held by the specified `original`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bslstl/Variant_Base/2constructor-0b9.adoc[Variant&lowbar;Base](xref:BloombergLP/bslstl/Variant_Base.adoc[Variant&lowbar;Base]&& original);
----

[.small]#xref:BloombergLP/bslstl/Variant_Base/2constructor-0b9.adoc[_» more&period;&period;&period;_]#

Create a `Variant&lowbar;Base` object whose index is the specified `index` without constructing an alternative object&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bslstl/Variant_Base/2constructor-05.adoc[Variant&lowbar;Base](
    xref:BloombergLP/bslstl/Variant_ConstructFromStdTag.adoc[Variant&lowbar;ConstructFromStdTag] fromStdTag,
    size&lowbar;t index);
----

[.small]#xref:BloombergLP/bslstl/Variant_Base/2constructor-05.adoc[_» more&period;&period;&period;_]#

Create a `Variant&lowbar;Base` object holding the 0th alternative, which is value&hyphen;initialized&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bslstl/Variant_Base/2constructor-0bb.adoc[Variant&lowbar;Base](
    std::allocator&lowbar;arg&lowbar;t allocatorArg,
    xref:BloombergLP/bslstl/Variant_Base/allocator_type.adoc[allocator&lowbar;type] allocator);
----

[.small]#xref:BloombergLP/bslstl/Variant_Base/2constructor-0bb.adoc[_» more&period;&period;&period;_]#

Create a `Variant&lowbar;Base` object holding the alternative with index (template parameter) `t&lowbar;INDEX`, direct&hyphen;initialized from the specified `args`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    size&lowbar;t t&lowbar;INDEX,
    class&period;&period;&period; t&lowbar;ARGS&gt;
explicit
xref:BloombergLP/bslstl/Variant_Base/2constructor-02.adoc[Variant&lowbar;Base](
    bsl::in&lowbar;place&lowbar;index&lowbar;t&lt;t&lowbar;INDEX&gt; inPlaceIndex,
    t&lowbar;ARGS&&&period;&period;&period; args);
----

[.small]#xref:BloombergLP/bslstl/Variant_Base/2constructor-02.adoc[_» more&period;&period;&period;_]#

Create a `Variant&lowbar;Base` object holding the same alternative (if any) held by the specified `original` object&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bslstl/Variant_Base/2constructor-089.adoc[Variant&lowbar;Base](
    std::allocator&lowbar;arg&lowbar;t allocatorArg,
    xref:BloombergLP/bslstl/Variant_Base/allocator_type.adoc[allocator&lowbar;type] allocator,
    xref:BloombergLP/bslstl/Variant_Base/Variant.adoc[Variant] const& original);
----

[.small]#xref:BloombergLP/bslstl/Variant_Base/2constructor-089.adoc[_» more&period;&period;&period;_]#

See the corresponding copy constructor above&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bslstl/Variant_Base/2constructor-0e.adoc[Variant&lowbar;Base](
    std::allocator&lowbar;arg&lowbar;t allocatorArg,
    xref:BloombergLP/bslstl/Variant_Base/allocator_type.adoc[allocator&lowbar;type] allocator,
    xref:BloombergLP/bslstl/Variant_Base/Variant.adoc[Variant]&& original);
----

[.small]#xref:BloombergLP/bslstl/Variant_Base/2constructor-0e.adoc[_» more&period;&period;&period;_]#

Create a `Variant&lowbar;Base` object whose index is the specified `index` without constructing an alternative object&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bslstl/Variant_Base/2constructor-0b4.adoc[Variant&lowbar;Base](
    std::allocator&lowbar;arg&lowbar;t allocatorArg,
    xref:BloombergLP/bslstl/Variant_Base/allocator_type.adoc[allocator&lowbar;type] allocator,
    xref:BloombergLP/bslstl/Variant_ConstructFromStdTag.adoc[Variant&lowbar;ConstructFromStdTag] fromStdTag,
    size&lowbar;t index);
----

[.small]#xref:BloombergLP/bslstl/Variant_Base/2constructor-0b4.adoc[_» more&period;&period;&period;_]#

Create a `Variant&lowbar;Base` object holding the alternative with index (template parameter) `t&lowbar;INDEX`, direct&hyphen;initialized from the specified `args`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    size&lowbar;t t&lowbar;INDEX,
    class&period;&period;&period; t&lowbar;ARGS&gt;
explicit
xref:BloombergLP/bslstl/Variant_Base/2constructor-04.adoc[Variant&lowbar;Base](
    std::allocator&lowbar;arg&lowbar;t allocatorArg,
    xref:BloombergLP/bslstl/Variant_Base/allocator_type.adoc[allocator&lowbar;type] allocator,
    bsl::in&lowbar;place&lowbar;index&lowbar;t&lt;t&lowbar;INDEX&gt; inPlaceIndex,
    t&lowbar;ARGS&&&period;&period;&period; args);
----

[.small]#xref:BloombergLP/bslstl/Variant_Base/2constructor-04.adoc[_» more&period;&period;&period;_]#

== Parameters

[cols="1,4"]
|===
| Name| Description
| *original*
| object to copy
| *fromStdTag*
| tag selecting this indexless construction overload
| *index*
| index of the alternative that will (later) be created
| *allocatorArg*
| tag selecting the allocator&hyphen;extended overload
| *allocator*
| allocator used to supply memory
| *inPlaceIndex*
| tag selecting the in&hyphen;place&hyphen;index constructor
| *args*
| arguments forwarded to the alternative&apos;s constructor
|===


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