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

时间:2021-01-06 09:11:08   收藏:0   阅读:279

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

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

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!