c++ typedef 一问# Programming - 葵花宝典
yy
1 楼
看了看一些source code, 有一些typedef读起着实比较费劲,
比如:
template
class SimpleCommand: public Command{
public:
typedef void (Receiver::* Action)();
SimpleCommand(Receiver* r, Action a):
_receiver(r), _action(a){}
virtual void Execute();
private:
Action _action;
Receiver* _receiver;
}
请问有什么比较简单的trick或者rule 来读这个 typedef
typedef void (Receiver::* Action)();
谢谢
比如:
template
class SimpleCommand: public Command{
public:
typedef void (Receiver::* Action)();
SimpleCommand(Receiver* r, Action a):
_receiver(r), _action(a){}
virtual void Execute();
private:
Action _action;
Receiver* _receiver;
}
请问有什么比较简单的trick或者rule 来读这个 typedef
typedef void (Receiver::* Action)();
谢谢