VisualStudio2010でhash_mapのキー値としてペアを使用してみてください。
コンパイルできませんでした。
int _tmain(int argc, _TCHAR* argv[])
{
hash_map <pair<int, int>, int> months;
months[pair<int, int>(2,3)] = 1;
int d;
cin >> d;
return 0;
}
エラーメッセージが表示されました:
エラー1エラーC2440:'タイプキャスト':'const std :: pair <_Ty1、_Ty2>'から'size_t'に変換できませんc:\ program files \ microsoft visual studio 10.0 \ vc \ include \ xhash 34 1 testApplication1
私はそれがおそらくのためhash_map
の専門を提供していないためであることを知っていますpair
。それを修正する簡単な方法はありますか?