首页 > Windows开发 > 详细

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

时间:2021-01-06 09:11:08      阅读:279      评论:0      收藏:0      [点我收藏+]

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

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

原文:https://www.cnblogs.com/xian-yongchao/p/14238496.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!