[#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. [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. [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`. [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. [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] fromStdTag, 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. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bslstl/Variant_Base/2constructor-0bb.adoc[Variant_Base]( std::allocator_arg_t allocatorArg, 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`. [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> inPlaceIndex, 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. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bslstl/Variant_Base/2constructor-089.adoc[Variant_Base]( std::allocator_arg_t allocatorArg, 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 allocatorArg, 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. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bslstl/Variant_Base/2constructor-0b4.adoc[Variant_Base]( std::allocator_arg_t allocatorArg, xref:BloombergLP/bslstl/Variant_Base/allocator_type.adoc[allocator_type] allocator, xref:BloombergLP/bslstl/Variant_ConstructFromStdTag.adoc[Variant_ConstructFromStdTag] fromStdTag, 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`. [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 allocatorArg, xref:BloombergLP/bslstl/Variant_Base/allocator_type.adoc[allocator_type] allocator, bsl::in_place_index_t<t_INDEX> inPlaceIndex, t_ARGS&&... args); ---- [.small]#xref:BloombergLP/bslstl/Variant_Base/2constructor-04.adoc[_» more..._]# == 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‐extended overload | *allocator* | allocator used to supply memory | *inPlaceIndex* | tag selecting the in‐place‐index constructor | *args* | arguments forwarded to the alternative's constructor |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#