C
Conrad Weyns
vc7.1 has no problem with the following snippet:
template <typename T> class TTest
{
std::list<T*>::iterator m_It;
};
but metrowerks codewarrior 9.2 kicks my butt and online Comeau confirms:
1. MW:
Warning : 'typename' is missing in template argument dependent qualified
type
Tests.cxx line 52 std::list<typename T*>::iterator it;
2. Comeau:
"ComeauTest.c", line 5: error: nontype "std::list<_Tp, _Alloc>::iterator
[with
_Tp=T *, _Alloc=std::allocator<T *>]" is not a type name
std::list<T*>::iterator m_It;
^
There were not that many places to insert "typename", so after a while I
found that the following makes
CW and Comeau happy:
template <typename T> class TTest
{
typename std::list<T*>::iterator m_It;
};
Can anyone here help me understand this?
regards,
Conrad Weyns
template <typename T> class TTest
{
std::list<T*>::iterator m_It;
};
but metrowerks codewarrior 9.2 kicks my butt and online Comeau confirms:
1. MW:
Warning : 'typename' is missing in template argument dependent qualified
type
Tests.cxx line 52 std::list<typename T*>::iterator it;
2. Comeau:
"ComeauTest.c", line 5: error: nontype "std::list<_Tp, _Alloc>::iterator
[with
_Tp=T *, _Alloc=std::allocator<T *>]" is not a type name
std::list<T*>::iterator m_It;
^
There were not that many places to insert "typename", so after a while I
found that the following makes
CW and Comeau happy:
template <typename T> class TTest
{
typename std::list<T*>::iterator m_It;
};
Can anyone here help me understand this?
regards,
Conrad Weyns