struct HLLess: binary_function<line2D,line2D,bool>这样的结构体定义是什么意思?

来源:百度知道 编辑:UC知道 时间:2024/06/04 10:46:34
struct HLLess: binary_function<line2D,line2D,bool>
{
bool operator()(const line2D& l1st,const line2D& l2nd) const
{
if(l1st.first.second<l2nd.first.second)
return true;
else if(l1st.first.second==l2nd.first.second && l1st.first.first<l2nd.first.first)
return true;
return false;
}

};

其实struct这里当作了class来用的

这个是定义函数对象的框架

你可以了解下具体的相关信息

参考:
http://blog.csdn.net/armman/archive/2007/03/18/1532645.aspx