13
有没有人知道模板类中超出声明模板方法的语法。超出模板类中模板方法的声明模板定义
例如:
template<class TYPE>
class thing
{
public :
void do_very_little();
template<class INNER_TYPE>
INNER_TYPE do_stuff();
};
第一种方法的定义:
template<class TYPE>
void thing<TYPE>::do_very_little()
{
}
我该怎么做第二个, “do_stuff”?
您的意思是声明do_stuff作为成员字段?假设你真的想要声明一个方法,它的参数是什么? – outis 2009-05-20 05:32:14
您需要在类声明中的do_stuff之后加上括号 – 2009-05-20 05:37:22