[#bsl-variant-2constructor-026]
= xref:bsl.adoc[bsl]::xref:bsl/variant.adoc[variant]::variant
:relfileprefix: ../../
:mrdocs:

Create a `variant` object holding a moved copy of `original`&apos;s alternative using `allocator`&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class t&lowbar;FIRST = t&lowbar;HEAD&gt;
requires BloombergLP&colon;&colon;bslstl&colon;&colon;
                Variant&lowbar;IsMoveConstructibleAll&lt;t&lowbar;FIRST, t&lowbar;TAIL&period;&period;&period;&gt;&colon;&colon;value
variant(
    std::allocator&lowbar;arg&lowbar;t allocatorArg,
    xref:bsl/variant/allocator_type.adoc[allocator&lowbar;type] allocator,
    xref:bsl/variant.adoc[variant]&& original);
----

== Description

Create a `variant` object holding the same alternative (if any) held by the specified `original`&period; If this `variant` is allocator&hyphen;aware, the specified `allocator` is used to supply memory&period; If `original` is not valueless by exception, the contained value is move&hyphen;constructed from the contained value of `original`&period; This constructor participates in overload resolution only if all alternatives are move constructible&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *allocatorArg*
| tag selecting the allocator&hyphen;extended overload
| *allocator*
| allocator used to supply memory
| *original*
| variant to move from
|===


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