bool CBase::A(std::vector<Node> &Node, float time)
{
Node HeadNode;
std::vector<Node>::iterator NodeIterLast;
std::vector<Node>::iterator NodeIter;
for (NodeIter = Node.begin(); NodeIter != Node.end(); NodeIter++)
{
if (NodeIter == Node.begin())
HeadNode = *NodeIter;
else if (NodeIter == &pathNode[1]) //这里报错
{
pathNodeIterLast = pathNodeIter;
}
(余下省略)......
}
error C2678: 二进制“==”: 没有找到接受“std::_Vector_iterator<_Ty,_Alloc>”类型的左操作数的运算符(或没有可接受的转换)
请大家指教,多谢!!!
------解决方案--------------------------------------------------------
改成
*NodeIter == Node[1]
可否?
------解决方案--------------------------------------------------------
&*NodeIter