[#BloombergLP-bslstl-Function_InvokerUtil] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslstl.adoc[bslstl]::Function_InvokerUtil :relfileprefix: ../../ :mrdocs: This struct is a namespace containing a single function template, `invokerForFunc`, that returns a pointer to a function that is used to invoke a callable object of a particular type. == Synopsis Declared in `<bslstl_function_invokerutil.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- struct Function_InvokerUtil; ---- == Types [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bslstl/Function_InvokerUtil/IsFuncInvocable.adoc[`IsFuncInvocable`] | 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. |=== == Type Aliases [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bslstl/Function_InvokerUtil/GenericInvoker.adoc[`GenericInvoker`] | Generic function pointer. This type is as close as we can get to `void *` for function pointers. |=== == Enums [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bslstl/Function_InvokerUtil/_04enum.adoc[`Unnamed enum`] | Enumeration of the different types of callable objects. |=== == Static Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bslstl/Function_InvokerUtil/invokerForFunc-03.adoc[`invokerForFunc`] | `invokerForFunc` overloads | xref:BloombergLP/bslstl/Function_InvokerUtil/throwBadFunctionCall.adoc[`throwBadFunctionCall`] [.small]#[noreturn]# | Throw a `bsl::bad_function_call` exception in an exception‐enabled build; otherwise, invoke the currently installed assertion violation handler. Note that providing a function to throw an exception moves the code generated to throw the exception into just one place rather than inline in every function template instantiation that would call it. It also insulates the header files from the declaration of the exception class itself, so that only clients catching `bad_function_call` need to include its header. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#