#include <iostream>
using namespace std;
class Say{
public:
void operator()(){ //重载()符号
printf("hello ()");
}
};
int main(){
Say s;
s(); //像函数一样调用,其实是一个类
system("pause");
return 0;
}
C++ 之 伪函数
最新推荐文章于 2023-10-13 10:38:42 发布
#include <iostream>
using namespace std;
class Say{
public:
void operator()(){ //重载()符号
printf("hello ()");
}
};
int main(){
Say s;
s(); //像函数一样调用,其实是一个类
system("pause");
return 0;
}