VS2005 C++ コードを VS2010 コードに変換しています。残念ながら、VS2010 ではコンパイラの警告が表示されますが、VS2005 ではスムーズにコンパイルされます。(参考までに、警告をエラーとして処理するように設定しました)。
Pls はコード スニペットを見てください:
エラーは、フレンド宣言がある行にあります。
class __declspec(dllexport) MyKey
{
friend size_t stdext::hash_value<MyKey>(const MyKey& key); // compiler warning at this line (pls see below for the actual compiler warning)
ubit32 m_uKey1;
};
template<> inline size_t stdext::hash_value<MyKey>(const MyKey& key)
{
return key.m_uKey1;
}
以下に示すように、コンパイラの警告は次のとおりです。
warning C4396: 'stdext::hash_value' : the inline specifier cannot be used when a friend declaration refers to a specialization of a function template
このエラーを解決するのを手伝ってください。ありがとう。