[#BloombergLP-bdlb-Variant19-2constructor-064] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlb.adoc[bdlb]::xref:BloombergLP/bdlb/Variant19.adoc[Variant19]::Variant19 :relfileprefix: ../../../ :mrdocs: Constructors == Synopses Declared in `<bdlb_variant.h>` Create a variant object in the unset state that uses the currently installed default allocator to supply memory. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bdlb/Variant19/2constructor-0e2.adoc[Variant19](); ---- [.small]#xref:BloombergLP/bdlb/Variant19/2constructor-0e2.adoc[_» more..._]# Create a variant by moving from `original`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bdlb/Variant19/2constructor-065.adoc[Variant19](xref:BloombergLP/bslmf/MovableRef.adoc[bslmf::MovableRef<Variant19>] original); ---- [.small]#xref:BloombergLP/bdlb/Variant19/2constructor-065.adoc[_» more..._]# Create a variant from `valueOrAllocator`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class TYPE_OR_ALLOCATOR> explicit xref:BloombergLP/bdlb/Variant19/2constructor-00.adoc[Variant19](TYPE_OR_ALLOCATOR const& valueOrAllocator); ---- [.small]#xref:BloombergLP/bdlb/Variant19/2constructor-00.adoc[_» more..._]# Create a variant by moving from the specified `value`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class TYPE> explicit xref:BloombergLP/bdlb/Variant19/2constructor-08.adoc[Variant19](TYPE&& value) requires !bsl::is_same< SelfType, typename bsl::remove_const< typename bsl::remove_reference<TYPE>::type>::type>::value && !bsl::is_convertible<TYPE, bslma::Allocator *>::value; ---- [.small]#xref:BloombergLP/bdlb/Variant19/2constructor-08.adoc[_» more..._]# Create a variant holding `value` using `basicAllocator`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class TYPE> xref:BloombergLP/bdlb/Variant19/2constructor-0e5.adoc[Variant19](TYPE&& value) requires !bsl::is_same< SelfType, typename bsl::remove_const< typename bsl::remove_reference<TYPE>::type>::type>::value; ---- [.small]#xref:BloombergLP/bdlb/Variant19/2constructor-0e5.adoc[_» more..._]# Create a variant from `original` using `basicAllocator`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bdlb/Variant19/2constructor-0b.adoc[Variant19]( xref:BloombergLP/bslmf/MovableRef.adoc[bslmf::MovableRef<Variant19>] original, xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator); ---- [.small]#xref:BloombergLP/bdlb/Variant19/2constructor-0b.adoc[_» more..._]# Create a variant with the type and value of `original`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bdlb/Variant19/2constructor-01.adoc[Variant19]( xref:BloombergLP/bdlb/Variant19.adoc[Variant19] const& original, xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0); ---- [.small]#xref:BloombergLP/bdlb/Variant19/2constructor-01.adoc[_» more..._]# Create a variant holding `value` using `basicAllocator`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class TYPE> xref:BloombergLP/bdlb/Variant19/2constructor-067.adoc[Variant19]( TYPE const& value, xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator); ---- [.small]#xref:BloombergLP/bdlb/Variant19/2constructor-067.adoc[_» more..._]# == Parameters [cols="1,4"] |=== | Name| Description | *original* | source variant to copy or move from | *valueOrAllocator* | held value, or allocator if convertible to `bslma::Allocator *` | *value* | value assigned to or stored in this variant | *basicAllocator* | allocator used to supply memory |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#