重载小于号

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

 

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