[#BloombergLP-bslstl-Function_IsReferenceCompatible-0c]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslstl.adoc[bslstl]::Function&lowbar;IsReferenceCompatible
:relfileprefix: ../../
:mrdocs:

This metafunction is derived from `true&lowbar;type` if a reference to the specified `FROM&lowbar;TYPE` parameter type can be substituted for a reference to the specified `TO&lowbar;TYPE` parameter type with no loss of information&semi; otherwise, it is derived from `false&lowbar;type`&period; By default, this metafunction yields `true&lowbar;type` if `FROM&lowbar;TYPE` is the same as `TO&lowbar;TYPE`&semi; else it yields `false&lowbar;type`&period; `bdef&lowbar;Function` should specialize this template to yield `true&lowbar;type` when `FROM&lowbar;TYPE` is an instantiation of `bdef&lowbar;Function` and `TO&lowbar;TYPE` is the corresponding instantiation of `bsl&colon;&colon;function` with the same function prototype&period; Instantiation will fail if either `FROM&lowbar;TYPE` or `TO&lowbar;TYPE` are reference types&period;

== Synopsis

Declared in `&lt;bslstl&lowbar;function&lowbar;isreferencecompatible&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class FROM&lowbar;TYPE,
    class TO&lowbar;TYPE&gt;
struct Function&lowbar;IsReferenceCompatible
    : bsl::is&lowbar;same&lt;FROM&lowbar;TYPE, TO&lowbar;TYPE&gt;::type
----

== Base Classes

[cols="1,4"]
|===
| Name| Description
| `bsl::is&lowbar;same&lt;FROM&lowbar;TYPE, TO&lowbar;TYPE&gt;::type`
| 
|===

== Specializations

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bslstl/Function_IsReferenceCompatible-0f.adoc[`Function&lowbar;IsReferenceCompatible&lt;FROM&lowbar;TYPE, TO&lowbar;TYPE const&gt;`] 
| Partial specialization of `Function&lowbar;IsReferenceCompatible` for `TO&lowbar;TYPE` being const&period; The evaluation is forwarded to other specializations after stripping the const qualifiers&period; Note that if `FROM&lowbar;TYPE` is const and `TO&lowbar;TYPE` is mutable, this partial specialization will not be selected and the resulting evaluation will yield `false&lowbar;type`, reflecting the fact that a reference to const type cannot be substituted with a reference to mutable type&period;
|===


== Derived Classes

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bslstl/Function_IsReferenceCompatible-0f.adoc[`Function&lowbar;IsReferenceCompatible&lt;FROM&lowbar;TYPE, TO&lowbar;TYPE const&gt;`] 
| Partial specialization of `Function&lowbar;IsReferenceCompatible` for `TO&lowbar;TYPE` being const&period; The evaluation is forwarded to other specializations after stripping the const qualifiers&period; Note that if `FROM&lowbar;TYPE` is const and `TO&lowbar;TYPE` is mutable, this partial specialization will not be selected and the resulting evaluation will yield `false&lowbar;type`, reflecting the fact that a reference to const type cannot be substituted with a reference to mutable type&period;
|===


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