[#BloombergLP-bslstl-Function_InvokerUtil-IsFuncInvocable] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslstl.adoc[bslstl]::xref:BloombergLP/bslstl/Function_InvokerUtil.adoc[Function_InvokerUtil]::IsFuncInvocable :relfileprefix: ../../../ :mrdocs: This `struct` template implements a Boolean metafunction that publicly inherits from `bsl::true_type` if an object of the specified `FUNC` type is invocable under the specified `PROTOTYPE`, and publicly inherits from `bsl::false_type` otherwise. An object of `FUNC` type is invocable under the `PROTOTYPE` if it is Lvalue‐Callable with the arguments of the `PROTOTYPE` (as forwarded by the facilities of 'bslmf_forwardingtype), and returns an object of type explicitly convertible to the return type of the `PROTOTYPE`. If the return type of the `PROTOTYPE` is `void`, then any type is considered explicitly convertible to the return type of the `PROTOTYPE`. This `struct` template requires `PROTOTYPE` to be an unqualified function type. == Synopsis Declared in `<bslstl_function_invokerutil.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class PROTOTYPE, class FUNC> struct IsFuncInvocable : xref:BloombergLP/bslstl/Function_InvokerUtil_IsFuncInvocable-05.adoc[Function_InvokerUtil_IsFuncInvocable<PROTOTYPE, FUNC>] ---- == Description Note that `IsFuncInvocable` is qualitatively different than `std::is_invocable_r`, in that it makes concessions for supporting legacy behavior of `bsl::function`. `std::is_invocable_r<RET, FUNC, ARGS...>` requires that the return type of the invocation of `FUNC` with `ARGS...` be implicitly convertible to `RET`, as opposed to explicitly convertible. Further, the use of `bslmf::ForwardingType` to forward arguments in the invoker of a `bsl::function` creates qualitatively different behavior than the argument forwarding mechanism used by the standard `INVOKE` pseudo‐expression. == Base Classes [cols="1,4"] |=== | Name| Description | `xref:BloombergLP/bslstl/Function_InvokerUtil_IsFuncInvocable-05.adoc[Function_InvokerUtil_IsFuncInvocable<PROTOTYPE, FUNC>]` | forward declaration |=== == Derived Classes [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bslstl/Function_IsInvocableWithPrototype-00.adoc[`Function_IsInvocableWithPrototype<RET(ARGS...), FUNC>`] | This component‐private `struct` template provides a boolean metafunction that derives from `bsl::true_type` if a `bsl::function` object having a prototype of `RET(ARGS...)` is constructible from an object of type `FUNC`, and derives from `bsl::false_type` otherwise. This metafunction is a wrapper around `bsl::invoke_result` that unwraps `FUNC` if it is a specialization of `bslalg::NothrowMovableWrapper`; and, if `bsl::invoke_result` provides a nested `type` typedef for `FUNC` and `RET` is non‐void, checks that the return type of the invoke operation on `FUNC` is convertible to `RET`. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#