1、
int (*f) (int x); //有些编译器可能不通过
2、
typedef int (*fun_ptr)(int,int);
osg对opengl函数的封装采用
void (GL_APIENTRY * glDeleteProgram)(GLuint program);
typedef char (*PTRFUN)(int);
PTRFUN pFun;
char glFun(int a){ return;}
pFun = glFun;
(*pFun)(2);
3、为类注入函数
为类型C注入Getter、Setter函数
template<typename C>
class StringSerializer : public TemplateSerializer<std::string>
{
public:
typedef const std::string& (C::*Getter)() const;
typedef void (C::*Setter)( const std::string& );
public:
Getter _getter;
Setter _setter;
};