terminate called after throwing an instance of 'std::out_of_range' what(): _Map_base::at


描述:运行右边的代码代码: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, 所以构造此类的对象需要在堆上进行。


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM