2012-11-07 61 views
0

我收到以下错误。错误C2544:期望的')'运营商'()'

typedef std::vector<std::pair<std::string, void*> > PropInfoType; 
#define REGISTER_FUNCTOR(type, func) \ 
    template <typename OWNER> \ 
    struct writeCharFunctor { \ 
    void operator(PropInfoType::iterator& it)() { \ 
    } \ 
    }; 

    REGISTER_FUNCTOR(char,writeChar); 

MSDN只是说,这是由于macro expansion

如果我改变void operator(PropInfoType::iterator& it)()void operator()()它的工作原理

回答

4

它可能应该包含

void operator() (PropInfoType::iterator& it) { \ 

因为operator关键字应遵循由运营商自己负责。