下面的语句怎么会有错误呢?
定义下面的语句:
typedef _A::reference reference;
typedef _A::const_reference const_reference;
(A是template <typename _Ty, class _A = std::allocator<_Ty> >)
提示错误:
1>f:\练习\.h(117) : warning C4346: '_A::reference' : dependent name is not a type
1> prefix with 'typename' to indicate a type
1> f:\练习.h(185) : see reference to class template instantiation 'CTaggedValueBuffer<_Ty,_A>' being compiled
1>f:\练习\.h(117) : error C2146: syntax error : missing ';' before identifier 'reference'
1>f:\练习\.h(117) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>f:\练习\.h(118) : warning C4346: '_A::const_reference' : dependent name is not a type
1> prefix with 'typename' to indicate a type
1>f:\练习\.h(118) : error C2146: syntax error : missing ';' before identifier 'const_reference'
1>f:\练习\.h(118) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int