C++ 自定义比较函数出现 invalid comparator 问题

在使用priority_queue、map、sort等,传入自定义比较函数时,

comparator需要strict weak ordering,即comparator(x,x)必须返回false。

posted @ 2022-03-18 18:13  80k  阅读(546)  评论(0)    收藏  举报