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

相关文章:

  • 2021-12-20
  • 2021-04-28
  • 2022-02-11
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-16
猜你喜欢
  • 2022-12-23
  • 2021-06-22
  • 2021-12-01
  • 2021-07-17
  • 2022-12-23
  • 2022-12-23
  • 2021-09-19
相关资源
相似解决方案