So I am relatively new to C++ and I am having an issue with the following std::vector::const_iterator:
for (vector<shared_ptr<FSNode>>::const_iterator itr = curNode->GetSubNodes().begin() ; itr != curNode->GetSubNodes().end(); itr++)
{
shared_ptr<FSNode> nextNode = *itr;
GetXMLFromNode(nextNode, xmlDom, dirEle);
}
The GetSubNodes accessor
const std::vector<shared_ptr<FSNode>> FSNode::GetSubNodes()
{
return subNodes_;
}
Basically getting a run time error where itr is expected to be a regular iterator. Does anybody know where I am going wrong? Likely a really simple issue but I am not seeing it right now.