我正在努力修复和理解编译器报告为错误的简单代码,该代码应为Klass
定义调用运算符:
template<typename T>
class Klass{
T operator(){ return T; }
};
g ++ 7.3报告:
a.cpp:3:26: error: declaration of ‘operator()’ as non-function
T operator(){ return T; }
^
a.cpp:3:26: error: expected ‘;’ at end of member declaration
怎么了?