#include<vector>
class Edge;
class Node {
public:
int index;
std::vector<Edge> outs;
};
class Edge {
public:
double weight;
Node vertex;
};
Strictly speaking, Node should use Edge pointers or references, or explicitly support incomplete type containers. However, generally vectors are implemented based on pointers, so there is no problem.
Let me make a statement first.
Strictly speaking, Node should use Edge pointers or references, or explicitly support incomplete type containers. However, generally vectors are implemented based on pointers, so there is no problem.
Calling classes to each other feels like there is something wrong with this design