在进入函数的某个地方animationWithFrames
,我的向量丢失了它的项目。
这实际上是一个CCMutableArray,它是 std::vector 的薄包装。
template<class T = CCObject*>
class CCMutableArray : public CCObject
{
public:
typedef std::vector<T> CCObjectArray;
typedef typename CCObjectArray::iterator CCMutableArrayIterator;
typedef typename CCObjectArray::reverse_iterator CCMutableArrayRevIterator;
public:
// ... helper functions ...
private:
std::vector<T> m_array;
};
我没有得到的是,当我将变量帧发送到函数中时,调试器接受它有一个变量 m_array ,其中包含 2 个项目。
但在函数内部,变量似乎进入了“幽灵”形式。
框架包含:
m_array=[ 2 ](0x051d5078 ... )
但扩展, m_array 包含
[0]()
.
什么会导致调试器像这样不一致?
顺便说一句,代码看不到这些项目。他们在运输途中消失了。那就是问题所在。
Visual Studio 2010。在 2008 年运行良好。我可能会降级以做一些工作。