I'm trying to learn how maps work and how to implement them for Graphs. I keep getting the error above. I assume it's because the '<' is taking less than data it is not suppose to.
using namespace std;
struct Node {
string name;
int val;
Node(string n) {
name = n;
val = 0;
}
};
struct AdjList {
map<Node, list<Node*>> adj;
map<Node, list<Node*>>::iterator it;
int type;
AdjList(int a) {
type = a;
}
void add(Node temp) {
it = adj.end();
list <Node*> hi;
adj.insert(pair <Node, list <Node*>>(temp, hi));
}
void connect(Node *a, Node *b) {
adj.find(*a)->second.push_back(b);
if (type == 1) {
adj.find(*b)->second.push_back(a);
}
}
void connect(Node *a, vector <Node*> b) {
for (int i = 0; i < b.size(); i++) {
connect(a, b[i]);
}
}
};