Compile error:dependent name is not a type
I'm getting a compile error on vs2005 that I dont understand. The
help
explains that this is a breaking change for VC++.NET 2005 compiler,
made in
order to conform to the ISO C++ standard, and I've tried it using evc+
+ 4.0 sp4 and
it compiles ok.
Code is as follows.............
//paramstring.h
template <class T> class ParameterStringAW
{
public:
typedef T* PT;
typedef const T* PCT;
class CKeyValuePair
{
protected:
TString m_strKey;
TString m_strValue;
BOOL m_bIgnoreCase;
public:
CKeyValuePair(PCT szKey, PCT szValue, BOOL bIgnoreCase) :
m_strKey(szKey), m_strValue(szValue),m_bIgnoreCase(bIgnoreCase)
{
}
~CKeyValuePair()
{
}
PCT GetValue() const
{
return m_strValue.c_str();
}
void SetValue( PCT szValue )
{
m_strValue = szValue;
}
PCT GetKey() const
{
return m_strKey.c_str();
}
BOOL Is( PCT szKeyToCompare) const
{
if (NULL == szKeyToCompare)
return FALSE;
if (m_bIgnoreCase)
return (0 == CompareNoCase(m_strKey, TString(szKeyToCompare)));
else
return ( m_strKey == szKeyToCompare );
}
};
typedef CKeyValuePair* PKeyValuePair;
typedef std::vector< PKeyValuePair > KeyValueList;
};
/
***********************************************************************************************************/
paramstring.cpp
template <class T>
ParameterStringAW<T>::PKeyValuePair ParameterStringAW<T>::Exists( PCT
szKey ) const // this is the line where i get errors...
{
}
warning C4346: 'ParameterStringAW<T>::PKeyValuePair' : dependent name
is not a type
prefix with 'typename' to indicate a type
error C2143: syntax error : missing ';' before
'ParameterStringAW<T>::Exists'
error C1903: unable to recover from previous error(s); stopping
compilation NMUTF8.cpp
Any insight would be appreciated.