Hey,
I was just wondering if anyone could tell me if there a big difference
between:
template<typename _uintX>
const class contact<_uintX>::uint_type contact<_uintX>::get_node_id()
const
{
return m_node_id;
}
And
template<typename _uintX>
const typename contact<_uintX>::uint_type
contact<_uintX>::get_node_id() const
{
return m_node_id;
}
It doesn't compile under vc71 with the class declaration
原帖由 steedhorse 于 2006-11-20 20:59 发表
class除了用来指示模板参数之外,当然还能用来定义类。
typename除了用来指示模板参数之外,还用来显式的指定某个东西是个类型,免得编译器有时分不出来像“A::a”这种东西到底是个类型名还是数据成员名。
欢迎光临 Chinaunix (http://bbs.chinaunix.net/) | Powered by Discuz! X3.2 |