Priority Queue Comparison

后端 未结 6 1767
心在旅途
心在旅途 2021-02-05 08:40

I\'m trying to declare a priority queue in c++ using a custom comparison function...

So , I declare the queue as follows:

std::priority_queue

        
6条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-02-05 08:57

    std::priority_queue, bool (*)compare(int, int)> pq(compare);
    

    Is another way not mentioned.

提交回复
热议问题