#include<iostream>
using namespace std;
class toInt
{
public:
toInt(int a){
cout<<"toInt construct"<<endl;
}
int operator()(int val)
{
cout<<"int operator()(int val)"<<endl;
return val+10;
}
};
int main()
{
toInt *t = new toInt(1);
cout<<(*t)(1)<<endl;
return 0;
}
c++重载函数调用运算符
最新推荐文章于 2025-02-15 19:08:10 发布
548

被折叠的 条评论
为什么被折叠?



