[#BloombergLP-bslstl-Variant_ConvertsWithoutNarrowing-0a]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslstl.adoc[bslstl]::xref:BloombergLP/bslstl/Variant_ConvertsWithoutNarrowing-0b.adoc[Variant&lowbar;ConvertsWithoutNarrowing]&lt;t&lowbar;DEST, t&lowbar;SOURCE, xref:bsl/void_t.adoc[bsl::void&lowbar;t&lt;decltype(Variant&lowbar;ArrayHelper&lt;t&lowbar;DEST&gt;&lcub;&lcub;std&colon;&colon;declval&lt;t&lowbar;SOURCE&gt;()&rcub;&rcub;)&gt;]&gt;
:relfileprefix: ../../
:mrdocs:

Determine whether `t&lowbar;SOURCE` converts to `t&lowbar;DEST` without narrowing&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class t&lowbar;DEST,
    class t&lowbar;SOURCE&gt;
struct xref:BloombergLP/bslstl/Variant_ConvertsWithoutNarrowing-0b.adoc[Variant&lowbar;ConvertsWithoutNarrowing]&lt;t&lowbar;DEST, t&lowbar;SOURCE, xref:bsl/void_t.adoc[bsl::void&lowbar;t&lt;decltype(Variant&lowbar;ArrayHelper&lt;t&lowbar;DEST&gt;&lcub;&lcub;std&colon;&colon;declval&lt;t&lowbar;SOURCE&gt;()&rcub;&rcub;)&gt;]&gt;
    : xref:bsl/integral_constant-02.adoc[bsl::integral&lowbar;constant&lt;bool, !(!Variant&lowbar;CheckForP1957R2&lt;bool&gt;&colon;&colon;value &amp;&amp; bsl&colon;&colon;is&lowbar;same&lt;bool, typename bsl&colon;&colon;remove&lowbar;cvref&lt;t&lowbar;DEST&gt;&colon;&colon;type&gt;&colon;&colon;value &amp;&amp; !bsl&colon;&colon;is&lowbar;same&lt;bool, typename bsl&colon;&colon;remove&lowbar;cvref&lt;t&lowbar;SOURCE&gt;&colon;&colon;type&gt;&colon;&colon;value)&gt;]
----

== Description

This component&hyphen;private metafunction is derived from `bsl&colon;&colon;true&lowbar;type` if (template parameter) `t&lowbar;SOURCE` can be converted to (template parameter) `t&lowbar;DEST` without narrowing, and `bsl&colon;&colon;false&lowbar;type` otherwise&period; A conversion from pointer or pointer&hyphen;to&hyphen;member type to cv `bool` is considered narrowing even if the compiler does not implement P1957R2 (which was adopted as a DR)&semi; however, on compilers that do not implement P1957R2, we do not have the ability to check whether a user&hyphen;defined conversion sequence to cv `bool` would use a narrowing standard conversion, so on those compilers, we permit conversion to a `t&lowbar;DEST` that is cv `bool` only if `t&lowbar;SOURCE` is also cv `bool`, and not when `t&lowbar;SOURCE` is a class type&period; This behavior is not expected to pose a problem for users migrating from `bdlb&colon;&colon;Variant`, because that class does not support implicit conversions from an argument type to an alternative type&period;

== Base Classes

[cols="1,4"]
|===
| Name| Description
| `xref:bsl/integral_constant-02.adoc[bsl::integral&lowbar;constant&lt;bool, !(!Variant&lowbar;CheckForP1957R2&lt;bool&gt;&colon;&colon;value &amp;&amp; bsl&colon;&colon;is&lowbar;same&lt;bool, typename bsl&colon;&colon;remove&lowbar;cvref&lt;t&lowbar;DEST&gt;&colon;&colon;type&gt;&colon;&colon;value &amp;&amp; !bsl&colon;&colon;is&lowbar;same&lt;bool, typename bsl&colon;&colon;remove&lowbar;cvref&lt;t&lowbar;SOURCE&gt;&colon;&colon;type&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;
|===



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