[#BloombergLP-bslstl-Variant_AssignsFromType] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslstl.adoc[bslstl]::Variant_AssignsFromType :relfileprefix: ../../ :mrdocs: Determine whether `t_TYPE` assigns to a unique alternative of `t_VARIANT`. == Synopsis Declared in `<bslstl_variant.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class t_VARIANT, class t_TYPE> struct Variant_AssignsFromType : xref:bsl/integral_constant-02.adoc[bsl::integral_constant<bool, !bsl::is_same<typename bsl::remove_cvref<t_TYPE>::type, t_VARIANT>::value && Variant_IsAlternativeConstructibleFrom<t_VARIANT, t_TYPE>::value && Variant_isAlternativeAssignableFrom<t_VARIANT, t_TYPE>::value>] ---- == Description This component‐private metafunction is derived from `bsl::true_type` if (template parameter) `t_TYPE` is neither a tag type nor the type (template parameter) `t_VARIANT` (modulo cv‐qualification), there is a unique best match alternative in `t_VARIANT` for `std::declval<t_TYPE>()`, and that alternative is constructible and assignable from `std::declval<t_TYPE>()`; otherwise, this metafunction is derived from `bsl::false_type`. This metafunction is used to constrain the converting assignment operator of `bsl::variant`. == Base Classes [cols="1,4"] |=== | Name| Description | `xref:bsl/integral_constant-02.adoc[bsl::integral_constant<bool, !bsl::is_same<typename bsl::remove_cvref<t_TYPE>::type, t_VARIANT>::value && Variant_IsAlternativeConstructibleFrom<t_VARIANT, t_TYPE>::value && Variant_isAlternativeAssignableFrom<t_VARIANT, t_TYPE>::value>]` | Metafunction representing a compile‐time constant of the specified (template parameter) `t_TYPE` with the specified (template parameter) `t_VALUE`. |=== == Type Aliases [cols="1,4"] |=== | Name| Description | xref:bsl/integral_constant-02/type.adoc[`type`] | Alias for this `integral_constant` specialization. | xref:bsl/integral_constant-02/value_type.adoc[`value_type`] | Alias for the (template parameter) `t_TYPE`. |=== == Member Functions [cols="1,4"] |=== | Name| Description | xref:bsl/integral_constant-02/operator_call.adoc[`operator()`] | Return a copy of the template argument `t_VALUE`. | xref:bsl/integral_constant-02/2conversion.adoc[`operator t_TYPE`] | Return a copy of the template argument `t_VALUE`. |=== == Static Data Members [cols="1,4"] |=== | Name| Description | xref:bsl/integral_constant-02/value.adoc[`value`] | The compile‐time constant value of this metafunction. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#