当我在Visual Studio C ++ 2008 Express中进行编译时:
template<class TKey, class TValue, class TKeyArg>
TGenMap<TKey, TValue, TKeyArg>::CGenMapAssoc* TGenMap<TKey, TValue, TKeyArg>::GetAssocNode (TKeyArg Key, dword& Hash) {
CGenMapAssoc* pAssoc;
/* Ignore if no table defined */
Hash = HashKey(Key) % m_HashTableSize;
if (m_ppHashTable == NULL) return (NULL);
for (pAssoc = m_ppHashTable[Hash]; pAssoc != NULL; pAssoc = pAssoc->pNext) {
if (CompareKeys(pAssoc->Key, Key)) return pAssoc;
}
return (NULL);
}
我收到以下错误:
1> c:\ mwedit-copia \ common \ contain \ dl_map.h(214):警告C4346:'TGenMap :: CGenMapAssoc':从属名称不是类型
1>以“ typename”作为前缀的类型
1> c:\ mwedit-copia \ common \ contain \ dl_map.h(214):错误C2143:语法错误:缺少';'在“ *”之前
1> c:\ mwedit-copia \ common \ contain \ dl_map.h(214):错误C4430:缺少类型说明符-假定为int。注意:C ++不支持default-int
1> c:\ mwedit-copia \ common \ contain \ dl_map.h(214):致命错误C1903:无法从先前的错误中恢复;停止编译
有什么避免的方法吗?谢谢。