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>

struct Function_InvokerUtil;

Types

Name

Description

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

Name

Description

GenericInvoker

Generic function pointer. This type is as close as we can get to void * for function pointers.

Enums

Name

Description

Unnamed enum

Enumeration of the different types of callable objects.

Static Member Functions

Name

Description

invokerForFunc

invokerForFunc overloads

throwBadFunctionCall [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.

Created with MrDocs