[#BloombergLP-bslstl-Variant_Base-2constructor-08d] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslstl.adoc[bslstl]::xref:BloombergLP/bslstl/Variant_Base.adoc[Variant_Base]::Variant_Base :relfileprefix: ../../../ :mrdocs: Constructors == Synopses Declared in `<bslstl_variant.h>` Create a `Variant_Base` object holding the 0th alternative, which is value‐initialized. If this `Variant_Base` is allocator‐aware, the currently installed default allocator is used to supply memory. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bslstl/Variant_Base/2constructor-00.adoc[Variant_Base](); ---- [.small]#xref:BloombergLP/bslstl/Variant_Base/2constructor-00.adoc[_» more..._]# Create a `Variant_Base` object holding the same alternative (if any) as the specified `original` object. If this `Variant_Base` is allocator‐aware, the currently installed default allocator is used to supply memory. If the `original` object is not valueless by exception', the contained value is copy‐constructed from the contained value of `original`. All alternatives shall be copy constructible. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bslstl/Variant_Base/2constructor-0f.adoc[Variant_Base](xref:BloombergLP/bslstl/Variant_Base.adoc[Variant_Base] const& original); ---- [.small]#xref:BloombergLP/bslstl/Variant_Base/2constructor-0f.adoc[_» more..._]# Create a `Variant_Base` object holding the same alternative (if any) held by the specified `original`. If this `Variant_Base` is allocator‐aware, the allocator of `original` is used to supply memory. If the `original` object is not valueless by exception, the contained value is move‐constructed from the contained value of `original`. All alternatives shall be move constructible. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bslstl/Variant_Base/2constructor-0b9.adoc[Variant_Base](xref:BloombergLP/bslstl/Variant_Base.adoc[Variant_Base]&& original); ---- [.small]#xref:BloombergLP/bslstl/Variant_Base/2constructor-0b9.adoc[_» more..._]# Create a `Variant_Base` object whose index is the specified `index` without constructing an alternative object. If this `Variant_Base` is allocator‐aware, the default allocator is used to supply memory. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bslstl/Variant_Base/2constructor-05.adoc[Variant_Base]( xref:BloombergLP/bslstl/Variant_ConstructFromStdTag.adoc[Variant_ConstructFromStdTag], size_t index); ---- [.small]#xref:BloombergLP/bslstl/Variant_Base/2constructor-05.adoc[_» more..._]# Create a `Variant_Base` object holding the 0th alternative, which is value‐initialized. If this `Variant_Base` is allocator‐aware, the specified `allocator` is used to supply memory. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bslstl/Variant_Base/2constructor-0bb.adoc[Variant_Base]( std::allocator_arg_t, xref:BloombergLP/bslstl/Variant_Base/allocator_type.adoc[allocator_type] allocator); ---- [.small]#xref:BloombergLP/bslstl/Variant_Base/2constructor-0bb.adoc[_» more..._]# Create a `Variant_Base` object holding the alternative with index (template parameter) `t_INDEX`, direct‐initialized from the specified `args`. If this `Variant_Base` is allocator‐aware, the currently installed default allocator is used to supply memory. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< size_t t_INDEX, class... t_ARGS> explicit xref:BloombergLP/bslstl/Variant_Base/2constructor-02.adoc[Variant_Base]( bsl::in_place_index_t<t_INDEX>, t_ARGS&&... args); ---- [.small]#xref:BloombergLP/bslstl/Variant_Base/2constructor-02.adoc[_» more..._]# Create a `Variant_Base` object holding the same alternative (if any) held by the specified `original` object. If this `Variant_Base` is allocator‐aware, the specified `allocator` is used to supply memory. If the `original` object is not valueless by exception, the contained value is copy/move constructed from the contained value of `original`. All alternatives shall be copy/move constructible. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bslstl/Variant_Base/2constructor-089.adoc[Variant_Base]( std::allocator_arg_t, xref:BloombergLP/bslstl/Variant_Base/allocator_type.adoc[allocator_type] allocator, xref:BloombergLP/bslstl/Variant_Base/Variant.adoc[Variant] const& original); ---- [.small]#xref:BloombergLP/bslstl/Variant_Base/2constructor-089.adoc[_» more..._]# See the corresponding copy constructor above. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bslstl/Variant_Base/2constructor-0e.adoc[Variant_Base]( std::allocator_arg_t, xref:BloombergLP/bslstl/Variant_Base/allocator_type.adoc[allocator_type] allocator, xref:BloombergLP/bslstl/Variant_Base/Variant.adoc[Variant]&& original); ---- [.small]#xref:BloombergLP/bslstl/Variant_Base/2constructor-0e.adoc[_» more..._]# Create a `Variant_Base` object whose index is the specified `index` without constructing an alternative object. If this `Variant_Base` is allocator‐aware, the specified `allocator` is used to supply memory. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bslstl/Variant_Base/2constructor-0b4.adoc[Variant_Base]( std::allocator_arg_t, xref:BloombergLP/bslstl/Variant_Base/allocator_type.adoc[allocator_type] allocator, xref:BloombergLP/bslstl/Variant_ConstructFromStdTag.adoc[Variant_ConstructFromStdTag], size_t index); ---- [.small]#xref:BloombergLP/bslstl/Variant_Base/2constructor-0b4.adoc[_» more..._]# Create a `Variant_Base` object holding the alternative with index (template parameter) `t_INDEX`, direct‐initialized from the specified `args`. If this `Variant_Base` is allocator‐aware, the specified `allocator` is used to supply memory. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< size_t t_INDEX, class... t_ARGS> explicit xref:BloombergLP/bslstl/Variant_Base/2constructor-04.adoc[Variant_Base]( std::allocator_arg_t, xref:BloombergLP/bslstl/Variant_Base/allocator_type.adoc[allocator_type] allocator, bsl::in_place_index_t<t_INDEX>, t_ARGS&&... args); ---- [.small]#xref:BloombergLP/bslstl/Variant_Base/2constructor-04.adoc[_» more..._]# [.small]#Created with https://www.mrdocs.com[MrDocs]#