BDE 4.39.x Production Release
Loading...
Searching...
No Matches
bslstl::Function_InvokerUtil Struct Reference

#include <bslstl_function_invokerutil.h>

Detailed Description

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.

See bslstl_function_invokerutil

Public Types

enum  {
  e_Null , e_FunctionPtr , e_MemFunctionPtr , e_MemDataPtr ,
  e_InplaceFunctor , e_OutofplaceFunctor
}
 
typedef Function_Rep::GenericInvoker GenericInvoker
 

Public Member Functions

template<class PROTOTYPE >
bslstl::Function_InvokerUtil::GenericInvokerinvokerForFunc (const bsl::nullptr_t &)
 
template<class PROTOTYPE , class FUNC >
bslstl::Function_InvokerUtil::GenericInvokerinvokerForFunc (const FUNC &f)
 

Static Public Member Functions

template<class PROTOTYPE >
static GenericInvokerinvokerForFunc (const bsl::nullptr_t &)
 
template<class PROTOTYPE , class FUNC >
static GenericInvokerinvokerForFunc (const FUNC &f)
 
static BSLA_NORETURN void throwBadFunctionCall ()
 

Member Typedef Documentation

◆ GenericInvoker

typedef Function_Rep::GenericInvoker bslstl::Function_InvokerUtil::GenericInvoker

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

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
e_Null 
e_FunctionPtr 
e_MemFunctionPtr 
e_MemDataPtr 
e_InplaceFunctor 
e_OutofplaceFunctor 

Member Function Documentation

◆ invokerForFunc() [1/4]

template<class PROTOTYPE >
static GenericInvoker * bslstl::Function_InvokerUtil::invokerForFunc ( const bsl::nullptr_t )
static

Return a null pointer.

Note
Note that template argument PROTOTYPE must be supplied excplicitly, as there is no way to deduce it from the function arguments.

◆ invokerForFunc() [2/4]

template<class PROTOTYPE >
bslstl::Function_InvokerUtil::GenericInvoker * bslstl::Function_InvokerUtil::invokerForFunc ( const bsl::nullptr_t )
inline

◆ invokerForFunc() [3/4]

template<class PROTOTYPE , class FUNC >
static GenericInvoker * bslstl::Function_InvokerUtil::invokerForFunc ( const FUNC &  f)
static

Return a pointer to the invoker for a callable object of (template paramter) type FUNC. If the specified f object is a null pointer or null pointer-to-member, return a null pointer.

Note
Note that template argument PROTOTYPE must be supplied excplicitly, as there is no way to deduce it from the function arguments.

◆ invokerForFunc() [4/4]

template<class PROTOTYPE , class FUNC >
bslstl::Function_InvokerUtil::GenericInvoker * bslstl::Function_InvokerUtil::invokerForFunc ( const FUNC &  f)

◆ throwBadFunctionCall()

static BSLA_NORETURN void bslstl::Function_InvokerUtil::throwBadFunctionCall ( )
static

Throw a bsl::bad_function_call exception in an exception-enabled build; otherwise, invoke the currently installed assertion violation handler.

Note
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.

The documentation for this struct was generated from the following file: