Provide meta-function to detect pointer to member traits.
More...
Namespaces |
namespace | bslmf |
Detailed Description
- Outline
-
-
- Purpose:
- Provide meta-function to detect pointer to member traits.
-
- Classes:
-
- See also:
- Component bslmf_memberfunctionpointertraits
-
- Description:
- This component provides a meta-function,
bslmf::MemberPointerTraits
, that determines traits of a pointer-to-member type, including the type of the object that it is a member of, and the type of the member it addresses.
-
- Usage:
- Define the following
struct
with the following members: struct MyTestClass {
int func1(int) { return 0; }
int d_int;
};
In order to deduce the types of func1
and d_int
, we will use bslmf::MemberPointerTraits
. The following program should compile and run without errors: void usageExample()
{
checkMemberPointer<int(int), MyTestClass>(&MyTestClass::func1);
checkMemberPointer<int, MyTestClass>(&MyTestClass::d_int);
}