In my code, I need to do this:
if (edges[j].ConnectedToNode() != i) //problem line
{
edges.push_back(Edge(i, j, nodes[i].Position(), nodes[j].Position(), distanceToNode));
}
however, there is a possibility that edges[j] does not exist yet. how can I test for this to avoid and index out-of-range exception? (This is to do with path nodes, essentially if there is an edge connecting j to i, I don't want to add another from i to j.