您的位置:首页 > 其它

记录一下结构体排序的问题(vector,map)

2018-01-31 18:07 267 查看
// 博客迁移:http://blog.timeash.cn

struct CoorEx

{

COOR co;

bool operator < (const CoorEx& cc )  const

{

if (algv3::ISZERO( cc.co.x - this->co.x ))

{

return cc.co.y < this->co.y;

}

else if (algv3::ISZERO( cc.co.y - this->co.y))

{

return cc.co.x < this->co.x;

}

else

return ( cc.co.x < this->co.x );

}

CoorEx& operator=( const CoorEx &cc)

{

this->co.x = cc.co.x;

this->co.y = cc.co.y;

this->co.z = cc.co.z;

return *this;

}

};
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: