I have created a class “Node” to contain a bunch of data. I am trying to make a list of the same type of this class. I am having errors in trying to use push_back() or any of the other functions.
error is the following:”
/home/…/FIFO.cpp|61|error: no matching function for call to ‘std::list >::push_back(Node*&)’|”
Node *tempProcess;
list<Node> processList; //list of all processes
tempProcess = new Node(tempArrivInt, tempExecInt);
processList.push_back(tempProcess);
Can someone please help?
The compiler error tells you “Couldn’t find a push_back function that takes a
Node *as parameter”. This is because your list containsNodeand notNode *, these are not the same types. Use: