c++ - 读取访问冲突。_Mycont 为 nullptr
问题描述
我正在尝试使用迭代器删除向量 STL 中的记录。但是抛出异常。
for (it = sp.begin(); it != sp.end(); ++it)
{
if (it->Id() == d)
{
sp.erase(it); //Where error starts
}
}
到达这些代码后,它会弹出错误异常
_STL_VERIFY(_Ptr < _Mycont->_Mylast, "can't increment vector iterator past end");
抛出异常:读取访问冲突。_Mycont 为 nullptr。
解决方案
推荐阅读
- firebase - Angularfire2 firebase Firestore 加入具有相同匹配字段或字段值的集合
- json - 如何删除密钥但保留孩子
- sql-server - SQL Server:清理旧数据需要太长时间
- android - 如何在成功的房间迁移时触发某些功能?
- c++11 - 枚举类意外
- python - 无法使用我的 SAM 应用程序访问 DynamoDB
- c++ - OpenCV 手动构建。没有这样的文件或目录#include "generated_16.i"
- validation - 验证 Knime 文件阅读器
- java - 使用 PdfMerger iText7 将 PdfDocument 转换为字节 []
- html - 如何在页眉中的图像旁边添加文本