これは私を3時間運転しています。誰もこれが動作していない理由を参照してください?stlのカスタムコンバーター
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
cust_typeはどのように定義されていますか? –
'struct cust_type {int a、int b、...; cust_type(int a、int b、...):a(a)、b(b){}} ' – baruch