这段代码clComp起到什么作用?涉及到什么知识点?
在classComp结构中定义了一个operator()函数,结构后面还添加上了clComp,clComp起到什么作用?涉及到什么知识点?
以及operator()是函数吗?为什么一定要添加operator()?如果是函数为什么后面还有个带2个参数的括号?
代码如下:
struct classComp{
bool operator()(int i,int j){return(i<j);}
}clComp
struct classComp{
bool operator()(int i,int j){return(i<j);}
}cmk;
程序代码:struct classComp{
bool operator()(int i,int j){return(i<j);}
}
void function(){};
clComp;struct classComp{
bool operator+(int i,int j){return(i<j);}
}clComp;[此贴子已经被作者于2021-4-3 19:06编辑过]