C++11 を使用してマップのマップを初期化しようとしています。私のコンパイラは VS 2013 Express です。
unordered_map<EnumType, unordered_map<string, string>> substitutions = {
{
Record::BasementType,
{
{ "0", "" },
{ "1", "Slab or pier" },
{ "2", "Crawl" }
}
},
{
Record::BuildingStyle,
{
{ "0", "" },
{ "1", "Ranch" },
{ "2", "Raised ranch" }
}
},
// ... and so on
};
コンパイルはできましたが、ntdll.dll 内でブレークポイントが発生しています。ただし、このコードの簡略版:
unordered_map<EnumType, unordered_map<string, string>> substitutions = {
{
Record::BasementType,
{
{ "0", "" },
{ "1", "Slab or pier" },
{ "2", "Crawl" }
}
},
// *nothing more*
};
正常に動作します。
マップに複数のペアがある場合、これが機能しないのはなぜですか? それをより良くする方法は?