[#BloombergLP-bslstl-Variant_ConvertsWithoutNarrowing-0a] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslstl.adoc[bslstl]::xref:BloombergLP/bslstl/Variant_ConvertsWithoutNarrowing-0b.adoc[Variant_ConvertsWithoutNarrowing]<t_DEST, t_SOURCE, xref:bsl/void_t.adoc[bsl::void_t<decltype(Variant_ArrayHelper<t_DEST>{{std::declval<t_SOURCE>()}})>]> :relfileprefix: ../../ :mrdocs: This component‐private metafunction is derived from `bsl::true_type` if (template parameter) `t_SOURCE` can be converted to (template parameter) `t_DEST` without narrowing, and `bsl::false_type` otherwise. A conversion from pointer or pointer‐to‐member type to cv `bool` is considered narrowing even if the compiler does not implement P1957R2 (which was adopted as a DR); however, on compilers that do not implement P1957R2, we do not have the ability to check whether a user‐defined conversion sequence to cv `bool` would use a narrowing standard conversion, so on those compilers, we permit conversion to a `t_DEST` that is cv `bool` only if `t_SOURCE` is also cv `bool`, and not when `t_SOURCE` is a class type. This behavior is not expected to pose a problem for users migrating from `bdlb::Variant`, because that class does not support implicit conversions from an argument type to an alternative type. == Synopsis Declared in `<bslstl_variant.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class t_DEST, class t_SOURCE> struct xref:BloombergLP/bslstl/Variant_ConvertsWithoutNarrowing-0b.adoc[Variant_ConvertsWithoutNarrowing]<t_DEST, t_SOURCE, xref:bsl/void_t.adoc[bsl::void_t<decltype(Variant_ArrayHelper<t_DEST>{{std::declval<t_SOURCE>()}})>]> : xref:bsl/integral_constant-02.adoc[bsl::integral_constant<bool, !(!Variant_CheckForP1957R2<bool>::value && bsl::is_same<bool, typename bsl::remove_cvref<t_DEST>::type>::value && !bsl::is_same<bool, typename bsl::remove_cvref<t_SOURCE>::type>::value)>] ---- == Base Classes [cols="1,4"] |=== | Name| Description | `xref:bsl/integral_constant-02.adoc[bsl::integral_constant<bool, !(!Variant_CheckForP1957R2<bool>::value && bsl::is_same<bool, typename bsl::remove_cvref<t_DEST>::type>::value && !bsl::is_same<bool, typename bsl::remove_cvref<t_SOURCE>::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`] | |=== == 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 value_type`] | |=== == Static Data Members [cols="1"] |=== | Name | xref:bsl/integral_constant-02/value.adoc[`value`] |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#