结构体内重载

时间:2021-04-08 13:16:49   收藏:0   阅读:0

注意是 d < x.d

struct Node {  
    int d, e;  
    bool operator < (const Node x) const {  
        return d < x.d;      //从小到大排序
    }   
}; 

 

 
评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!