C++ 成员函数原型与非成员函数原型定义的差异

C++ 成员函数原型与非成员函数原型定义的差异,c++,C++,我说的对吗,什么 typedef void(类名::*FunctionName)()是类成员函数原型的定义 及 typedef void(*FunctionName)()是非类或静态函数原型的定义 并且应该以不同的方式使用: 对于类函数 传递:RegisterFunction(&ClassName::function) 用法:(ClassPointer->*(ClassPointer->functionPointer))() 对于静态函数 通过:RegisterFunction(&functio

我说的对吗,什么

typedef void(类名::*FunctionName)()
是类成员函数原型的定义

typedef void(*FunctionName)()
是非类或静态函数原型的定义

并且应该以不同的方式使用:

对于类函数

传递:
RegisterFunction(&ClassName::function)

用法:
(ClassPointer->*(ClassPointer->functionPointer))()

对于静态函数

通过:
RegisterFunction(&function)

使用:
functionPointer()


或者我误解了什么?

函数的定义都不是;它们都是类型别名的定义。对不起,我是这个意思。谢谢更新的
(ClassPointer->*(ClassPointer->functionPointer))()
应该是
(ClassPointer->*functionPointer)(
,如果
functionPointer
不是该类的成员。确定。谢谢但在我的情况下,它是一个成员。是否正确?您是否需要在
类中使用
typedef
,只需要使用指向成员数据和成员函数的指针?