[#BloombergLP-bslstl-Variant_isAlternativeAssignableFrom-07]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslstl.adoc[bslstl]::Variant&lowbar;isAlternativeAssignableFrom
:relfileprefix: ../../
:mrdocs:

Determine whether the unique best&hyphen;match alternative is assignable&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class t&lowbar;VARIANT,
    class t&lowbar;TYPE,
    size&lowbar;t t&lowbar;INDEX = BloombergLP&colon;&colon;bslstl&colon;&colon;Variant&lowbar;ConvertIndex&lt;t&lowbar;TYPE, t&lowbar;VARIANT&gt;&colon;&colon;value&gt;
struct Variant&lowbar;isAlternativeAssignableFrom
    : xref:bsl/integral_constant-02.adoc[bsl::integral&lowbar;constant&lt;bool, Variant&lowbar;IsAssignable&lt;typename bsl&colon;&colon;variant&lowbar;alternative&lt;t&lowbar;INDEX, t&lowbar;VARIANT&gt;&colon;&colon;type &amp;, t&lowbar;TYPE&gt;&colon;&colon;value &amp;&amp; Variant&lowbar;HasUniqueCVType&lt;typename bsl&colon;&colon;variant&lowbar;alternative&lt;BloombergLP&colon;&colon;bslstl&colon;&colon;Variant&lowbar;ConvertIndex&lt;t&lowbar;TYPE, t&lowbar;VARIANT&gt;&colon;&colon;value, t&lowbar;VARIANT&gt;&colon;&colon;type, t&lowbar;VARIANT&gt;&colon;&colon;value&gt;]
----

== Description

This component&hyphen;private metafunction is derived from `bsl&colon;&colon;true&lowbar;type` if there is a unique best match alternative in (template parameter) `t&lowbar;VARIANT` for `std&colon;&colon;declval&lt;t&lowbar;TYPE&gt;()` and that alternative is both constructible and assignable from `std&colon;&colon;declval&lt;t&lowbar;TYPE&gt;()`, and `bsl&colon;&colon;false&lowbar;type` otherwise&period;

== Base Classes

[cols="1,4"]
|===
| Name| Description
| `xref:bsl/integral_constant-02.adoc[bsl::integral&lowbar;constant&lt;bool, Variant&lowbar;IsAssignable&lt;typename bsl&colon;&colon;variant&lowbar;alternative&lt;t&lowbar;INDEX, t&lowbar;VARIANT&gt;&colon;&colon;type &amp;, t&lowbar;TYPE&gt;&colon;&colon;value &amp;&amp; Variant&lowbar;HasUniqueCVType&lt;typename bsl&colon;&colon;variant&lowbar;alternative&lt;BloombergLP&colon;&colon;bslstl&colon;&colon;Variant&lowbar;ConvertIndex&lt;t&lowbar;TYPE, t&lowbar;VARIANT&gt;&colon;&colon;value, t&lowbar;VARIANT&gt;&colon;&colon;type, t&lowbar;VARIANT&gt;&colon;&colon;value&gt;]`
| Metafunction representing a compile&hyphen;time constant of the specified (template parameter) `t&lowbar;TYPE` with the specified (template parameter) `t&lowbar;VALUE`&period;
|===

== Type Aliases

[cols="1,4"]
|===
| Name| Description
| xref:bsl/integral_constant-02/type.adoc[`type`] 
| Alias for this `integral&lowbar;constant` specialization&period;
| xref:bsl/integral_constant-02/value_type.adoc[`value&lowbar;type`] 
| Alias for the (template parameter) `t&lowbar;TYPE`&period;
|===


== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:bsl/integral_constant-02/operator_call.adoc[`operator()`] 
| Return a copy of the template argument `t&lowbar;VALUE`&period;
| xref:bsl/integral_constant-02/2conversion.adoc[`operator t&lowbar;TYPE`] 
| Return a copy of the template argument `t&lowbar;VALUE`&period;
|===


== Static Data Members

[cols="1,4"]
|===
| Name| Description
| xref:bsl/integral_constant-02/value.adoc[`value`] 
| The compile&hyphen;time constant value of this metafunction&period;
|===


== Specializations

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bslstl/Variant_isAlternativeAssignableFrom-09.adoc[`Variant&lowbar;isAlternativeAssignableFrom&lt;t&lowbar;VARIANT, t&lowbar;TYPE, bsl&colon;&colon;variant&lowbar;npos&gt;`] 
| Derive from `bsl&colon;&colon;false&lowbar;type` when there is no unique best match&period;
|===



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