[#bsl-variant-2constructor-0b] = xref:bsl.adoc[bsl]::xref:bsl/variant.adoc[variant]::variant :relfileprefix: ../../ :mrdocs: Create a `variant` object holding a copy of `original`'s alternative using `allocator`. == Synopsis Declared in `<bslstl_variant.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class t_FIRST = t_HEAD> requires BloombergLP::bslstl:: Variant_IsCopyConstructibleAll<t_FIRST, t_TAIL...>::value variant( std::allocator_arg_t allocatorArg, xref:bsl/variant/allocator_type.adoc[allocator_type] allocator, xref:bsl/variant.adoc[variant] const& original); ---- == Description Create a `variant` object holding the same alternative (if any) as the specified `original` object. If this `variant` 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‐constructed from the contained value of `original`. This constructor is deleted unless all alternatives are copy constructible. == Parameters [cols="1,4"] |=== | Name| Description | *allocatorArg* | tag selecting the allocator‐extended overload | *allocator* | allocator used to supply memory | *original* | variant to copy |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#