函数指针

void func(void){}

//函数指针
void(*func_ptr)(void) = &func; 
func_ptr();
struct Foo
{
    void operator()(void){
    }
};
//仿函数
Foo foo;  
foo();
struct A
{
    int a_;
    void mem_func(void)
    {
        //...
    }
};
void(A::*mem_func_ptr)(void) = &A::mem_func;  //类成员函数指针
int A::*mem_obj_ptr = &A::a_;           //类成员指针

A aa;
(aa.
*mem_func_ptr)(); aa.*mem_obj_ptr = 123;
原文地址:https://www.cnblogs.com/osbreak/p/11087357.html