1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37 | class A {
public:
virtual ~A() {}
virtual void operator()() {
std::cout << "A" << std::endl;
}
}
struct B {
void operator()() {
std::cout << "B" << std::endl;
}
}
struct C {
bool operator==(int a, int b) const {
return a == b;
}
}
struct D {
int operator()(int a, int b) const {
return a + b;
}
struct E {
int operator=(int a, int b) const {
return a + b;
}
int main() {
A a;
B b;
a();
b();
}
|