I'm busy implementing a Graph ADT in C++. I have templates for the Edges and the Vertices. At each Vertex I have a vector containing pointers to the Edges that are incident to it. Now I'm trying to get an iterator over those edges. These are the lines of code:
vector<Edge<edgeDecor, vertexDecor, dir>*> edges = this->incidentEdges();
vector<Edge<edgeDecor, vertexDecor, dir>*>::const_iterator i;
for (i = edges.begin(); i != edges.end(); ++i) {
However, the compiler won't accept the middle line. I'm pretty new to C++. Am I missing something? Why can't I declare an iterator over objects from the Edge template? The compiler isn't giving any useful feedback.
Much thanks niel