I'm attempting to declare a priority queue of nodes using the comparator function bool Compare(Node a, Node b) (which is outside the node class).
I presently have the following:
priority_queue<Node, vector<Node>, Compare> openSet;
I'm receiving Error: "Compare" is not a type name for some reason.
Adding priority_queue<Node, vector Node>, bool Compare> to the declaration.
gives me the error 'Error: expecting a '>'
I've also attempted:
priority_queue<Node, vector<Node>, Compare()> openSet;
priority_queue<Node, ...READ MORE
Aug 11, 2022
in C++
by
Nicholas
• 7,760 points
•
947 views