The following code compiles fine in VC6 but when I compile the same project in VS2008 it gives the following error error C2146: syntax error : missing ';' before identifier 'm_pItr'
template <class pKey, class Data, class pCompare,
class hKey = int, class hCompare = less<hKey>,
class sKey = int, class sCompare = less<sKey>,
class tKey = int, class tCompare = less<tKey>,
class cKey = int, class cCompare = less<cKey>>
class GCache
{
private:
typedef map<pKey, Data, pCompare> PRIMARY_MAP;
PRIMARY_MAP pMap;
PRIMARY_MAP::iterator m_pItr; //error here
//Code truncated
}
Any ideas of what is wrong here? Someone with experience in migrating C++ code from VC6 to VC2005/2008 might be able to help.