特牛网址导航

39_函数调用符()的重载-CSDN博客

网友收藏
#include <iostream>using namespace std;class Fun{public: int my_add(int x,int y) { return x+y; } //重载() //第一个()是重载的符号 第二个()是标明要传参 int operator()(int x,int y) { return x+y; }};void test01(){ .