[#BloombergLP-bslstl-Function_InvokerUtil]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslstl.adoc[bslstl]::Function&lowbar;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&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
struct Function&lowbar;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&colon;&colon;true&lowbar;type` if an object of the specified `FUNC` type is invocable under the specified `PROTOTYPE`, and publicly inherits from `bsl&colon;&colon;false&lowbar;type` otherwise&period; An object of `FUNC` type is invocable under the `PROTOTYPE` if it is Lvalue&hyphen;Callable with the arguments of the `PROTOTYPE` (as forwarded by the facilities of &apos;bslmf&lowbar;forwardingtype), and returns an object of type explicitly convertible to the return type of the `PROTOTYPE`&period; If the return type of the `PROTOTYPE` is `void`, then any type is considered explicitly convertible to the return type of the `PROTOTYPE`&period; This `struct` template requires `PROTOTYPE` to be an unqualified function type&period;
|===


== Type Aliases

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bslstl/Function_InvokerUtil/GenericInvoker.adoc[`GenericInvoker`] 
| Generic function pointer&period; This type is as close as we can get to `void &ast;` for function pointers&period;
|===


== Enums

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bslstl/Function_InvokerUtil/_04enum.adoc[`Unnamed enum`] 
| Enumeration of the different types of callable objects&period;
|===


== 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&colon;&colon;bad&lowbar;function&lowbar;call` exception in an exception&hyphen;enabled build&semi; otherwise, invoke the currently installed assertion violation handler&period; 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&period; It also insulates the header files from the declaration of the exception class itself, so that only clients catching `bad&lowbar;function&lowbar;call` need to include its header&period;
|===



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