a.operator()(x,y)
by cosmicAC @ 2019-04-18 15:31:08
@[SarvaTathagata](/space/show?uid=30093) 还有吗?
by 枫初音斗颂皮 @ 2019-04-18 15:33:06
a(x,y)
by 142857cs @ 2019-04-18 15:41:33
@[142857cs](/space/show?uid=35760) 谢谢
by 枫初音斗颂皮 @ 2019-04-18 15:42:53
@[樱初音斗橡皮](/space/show?uid=66287) 可以这么用喵~
```cpp
#include<cstdio>
struct Node{
int operator () (int x, int y) {
return x + y;
}
};
Node nd;
int main() {
printf("%d\n", nd(1, 2));
}
```
by 龙之吻—水货 @ 2019-04-18 15:43:51
@[SarvaTathagata](/space/show?uid=30093) 您会误导人家的啦……
by MZW_BG @ 2019-04-18 15:51:04
@[樱初音斗橡皮](/space/show?uid=66287) 如果是变量名是`x`的话,就直接`x(a,b)`就可以了啦QωQ
by MZW_BG @ 2019-04-18 15:52:00
这有什么问题吗
by cosmicAC @ 2019-04-18 15:56:20
@[MZW_BG](/space/show?uid=97504)
by cosmicAC @ 2019-04-18 15:56:30
@[SarvaTathagata](/space/show?uid=30093) 大佬人家是在重载运算符啦QωQ
by MZW_BG @ 2019-04-18 16:08:06