Provide meta-functions to detect member function pointer traits.
More...
Detailed Description
- Outline
-
-
- Purpose:
- Provide meta-functions to detect member function pointer traits.
-
- Classes:
-
function pointer traits bslmf::IsMemberFunctionPointer: meta-function to determine if a type is a member function pointer
- See also:
- Component bslmf_functionpointertraits
-
- Description:
- This component provides meta-functions for determining the traits of a member function pointer. Two meta-functions are provided:
bslmf::IsMemberFunctionPointer
, and bslmf::MemberFunctionPointerTraits
. bslmf::IsMemberFunctionPointer
tests if a given type is a supported member function pointer. bslmf::MemberFunctionPointerTraits
determines the traits of a member function type, including the type of the object that it is a member of, its result type, and the type of its list of arguments.
- Note that, in order to support pre-C++11 compilers in a manageable way, only member functions with up to 14 arguments and no C-style (varargs) elipses are supported on all platforms by this component. When variadic templates are available, any number of arguments are supported. C-style elipses are not supported by this component at all. To identify all member function pointers see
bslmf_ismemberfunctionpointer
.
-
- Usage:
- Define the following function types:
typedef void (*VoidFunc0)();
and the following struct
with the following members: struct MyTestClass {
static void voidFunc0() {}
int func1(int) { return 0; }
int func2(int, int) { return 1; }
};
In order to deduce the types of voidFunc0
and func1
, we will use the C++ template system to get two auxiliary functions: The following program should compile and run without errors:
Define Documentation