重载小于号

struct node
{
    int from,to,w;
    bool operator < (const node & b) const
    {
        return w<b.w;
    }
} ;

 

posted @ 2017-08-14 23:25  xcantaloupe  阅读(421)  评论(0)    收藏  举报