[#BloombergLP-bslstl-Function_IsReferenceCompatible-0c] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslstl.adoc[bslstl]::Function_IsReferenceCompatible :relfileprefix: ../../ :mrdocs: This metafunction is derived from `true_type` if a reference to the specified `FROM_TYPE` parameter type can be substituted for a reference to the specified `TO_TYPE` parameter type with no loss of information; otherwise, it is derived from `false_type`. By default, this metafunction yields `true_type` if `FROM_TYPE` is the same as `TO_TYPE`; else it yields `false_type`. `bdef_Function` should specialize this template to yield `true_type` when `FROM_TYPE` is an instantiation of `bdef_Function` and `TO_TYPE` is the corresponding instantiation of `bsl::function` with the same function prototype. Instantiation will fail if either `FROM_TYPE` or `TO_TYPE` are reference types. == Synopsis Declared in `<bslstl_function_isreferencecompatible.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class FROM_TYPE, class TO_TYPE> struct Function_IsReferenceCompatible : bsl::is_same<FROM_TYPE, TO_TYPE>::type ---- == Base Classes [cols="1,4"] |=== | Name| Description | `bsl::is_same<FROM_TYPE, TO_TYPE>::type` | |=== == Specializations [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bslstl/Function_IsReferenceCompatible-0f.adoc[`Function_IsReferenceCompatible<FROM_TYPE, TO_TYPE const>`] | Partial specialization of `Function_IsReferenceCompatible` for `TO_TYPE` being const. The evaluation is forwarded to other specializations after stripping the const qualifiers. Note that if `FROM_TYPE` is const and `TO_TYPE` is mutable, this partial specialization will not be selected and the resulting evaluation will yield `false_type`, reflecting the fact that a reference to const type cannot be substituted with a reference to mutable type. |=== == Derived Classes [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bslstl/Function_IsReferenceCompatible-0f.adoc[`Function_IsReferenceCompatible<FROM_TYPE, TO_TYPE const>`] | Partial specialization of `Function_IsReferenceCompatible` for `TO_TYPE` being const. The evaluation is forwarded to other specializations after stripping the const qualifiers. Note that if `FROM_TYPE` is const and `TO_TYPE` is mutable, this partial specialization will not be selected and the resulting evaluation will yield `false_type`, reflecting the fact that a reference to const type cannot be substituted with a reference to mutable type. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#