这已经让我发疯了 3 个小时。有人知道这不起作用的原因吗?
struct sortByPropRev
{
bool operator()(const cust_type &a, const cust_type &b) const
{
return a.prop > b.prop;
}
};
...
priority_queue<cust_type, vector<cust_type>, sortByPropRev> x;
我得到编译错误:
Error C2664: 'bool (cust_type &,cust_type &)' : cannot convert parameter 1 from 'const cust_type' to 'cust_type &'
和另外 2 个一样,但在不同的行algorithm.h