template <class T>
class Edge;
template <class T>
class Vertex;
template <class T>
class Vertex
{
T key;
char color;
std::vector<Edge> adjVertices;
};
template <class T>
class Edge
{
Vertex* source;
Vertex* target;
};
Gives me error in line: std::vector< Edge > adjVertices;
error: error C2143: syntax error : missing ';' before '<'
see reference to class template instantiation 'ds::Vertex<T>' being compiled.
What should I change?
Your must
and change
to
The same applies to:
Next you’ll face the problem that
Vertexis defined beforeEdge. You should reverse the order.