我试图声明一个priority_queue of nodes
,bool Compare(Node a, Node b)
用作比较器函数(在节点类外部)。
我目前拥有的是:
priority_queue<Node, vector<Node>, Compare> openSet;
由于某种原因,我越来越 Error: "Compare" is not a type name
将声明更改为 priority_queue <Node, vector<Node>, bool Compare>
给我 Error: expected a '>'
我也尝试过:
priority_queue<Node, vector<Node>, Compare()> openSet;
priority_queue<Node, vector<Node>, bool Compare()> openSet;
priority_queue<Node, vector<Node>, Compare<Node, Node>> openSet;
我应该如何正确声明我的身份priority_queue
?