【发布时间】:2015-12-22 09:18:18
【问题描述】:
我有一个遍历列表的迭代器,我尝试将迭代器转换为对象。
std::list<XMLObjects>::const_iterator objectsIterator;
for (objectsIterator = frame->getObjectsList().begin(); objectsIterator != frame->getObjectsList().end(); ++objectsIterator)
{
XMLObjects object =(*objectsIterator);
}
但我得到一个错误:
OR_Comparator.exe 中 0x00007FFA9A658384 处未处理的异常: Microsoft C++ 异常:内存位置的 std::bad_alloc 0x0000007C0196C490.
我可以以一种好的方式转换它吗?
【问题讨论】:
-
你有什么错误?
-
OR_Comparator.exe 中 0x00007FFA9A658384 处未处理的异常:Microsoft C++ 异常:内存位置 0x0000007C0196C490 处的 std::bad_alloc。
-
FWIW,
*objectsIterator周围的括号不需要。 -
哇,将近 2 年之后您回来包含错误?我印象深刻。