重载小于号

struct node
{
    int from,to,w;
    bool operator < (const node & b) const
    {
        return w<b.w;
    }
} ;
原文地址:https://www.cnblogs.com/xcantaloupe/p/7361145.html