I found a bunch of threads about the "instantiated from here" problem. They all seemed to be people who created forgot a default constructor. I think my problem is different (however I am new to C++ and it could be a slight variation on the same problem and I just don't know how to implement the solution).
I am trying to insert into a set and apparently it is being instantiated from there. And it is throwing an error.
class Node{
public:
bool operator <(const Node& other){
return id < other.id;
}
class Graph {
public:
int poner;
map<string, Node> nodeMap;
set<Node> reachables;
void DepthFirstSearch(Node node){
reachables.clear(); //fine at this point
poner = 0;
DFS(node);
}
private:
void DFS(Node node){
reachables.insert(node); //instantiated from here
}
};
Node.h:131:25: instantiated from here
c:\..... errir: passing 'const Node' as 'this' argument of 'bool Node::operator<(const Node&)' discards qualifiers [-fpermissive]
Any help is always appreciated.