BDE 4.39.x Production Release
Loading...
Searching...
No Matches
bslmf_functionpointertraits

Detailed Description

Provide a meta-function for determining function pointer traits.

Outline

Purpose

Provide a meta-function for determining function pointer traits.

Classes

See also
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:

Typedefs

typedef bslmf::FunctionPointerCPlusPlusLinkage bslmf_FunctionPointerCPlusPlusLinkage
 
typedef bslmf::FunctionPointerCLinkage bslmf_FunctionPointerCLinkage
 

Macro Definition Documentation

◆ bslmf_FunctionPointerTraits

#define bslmf_FunctionPointerTraits   bslmf::FunctionPointerTraits

This alias is defined for backward compatibility.

◆ bslmf_IsFunctionPointer

#define bslmf_IsFunctionPointer   bslmf::IsFunctionPointer

This alias is defined for backward compatibility.

Typedef Documentation

◆ bslmf_FunctionPointerCLinkage

This alias is defined for backward compatibility.

◆ bslmf_FunctionPointerCPlusPlusLinkage

This alias is defined for backward compatibility.