描述:運行右邊的代碼代碼:Uisystem uiSystemService(xmlPath); (調用此類Uisystem 的構造函數能夠能夠正常運行到最后一行,調用完成構造函數之后就報錯,我找了好久都沒有找到原因。。。)
錯誤碼:terminate called after throwing an instance of 'std::out_of_range' what(): _Map_base::at
修改代碼:Uisystem* uiSystemService = new Uisystem(xmlPath);
原因:此類Uisystem的成員變量中有包含堆上的對象地址元素的map, 所以構造此類的對象需要在堆上進行。