template
class TimerApp
{
//friend class TimerApp;
typedef void (MessageHandlerClass::*HandlerMethod)();
public:
static void AddTimer(int interval,MessageHandlerClass *handler);
private:
static int interval_;
static HandlerMethod handler_method_; //回调函数指针
static MessageHandlerClass* handler_; //调用对象
static void OnTimer();
};
template int TimerApp::interval_ = 0;
template MessageHandlerClass * TimerApp::handler_ = 0;
请问handler_method_如何在类外初始化
补充:我尝试template HandlerMethod SubTimerApp::handler_method_ = 0;
报错:error: ‘HandlerMethod’ does not name a type