Provide a meta-function for determining function pointer traits.
More...
Detailed Description
- Outline
-
-
- Purpose:
- Provide a meta-function for determining function pointer traits.
-
- Classes:
-
traits bslmf::IsFunctionPointer: meta-function to determine if a type is a function pointer
- See also:
- Component bslmf_memberfunctionpointertraits
-
- Description:
- This component provides meta-functions for determining whether a type is a pointer to either a free function or a class method (but not to a member function, see the component
bslmf_memberfunctionpointertraits
component for that), and some information about this function type. The meta-function bslmf::IsFunctionPointer
provides an enumerated value
which can be either 1 or 0 depending on whether or not the template argument t_PROTOTYPE
is a pointer to a free function or class method. In the affirmative, the class bslmf::FunctionPointerTraits
also provides information regarding the function type, such as its argument list type and its return type.
- Note that there is no reference-to-function traits class, since whether
FUNC
is a reference to function type can be very easily obtained using the meta-function call bslmf::IsFunctionPointer<FUNC *>
.
-
- Usage:
- Define the following function types:
typedef int (*IntFunctionIntIntPtr)(int, int);
typedef void (*VoidFunc0)();
The following program should compile and run without errors:
Define Documentation
Typedef Documentation