坑同事技巧+1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
class Point
{
public:
Point() { _x = _y = 0; }

Point &operator()( int dx, int dy )
{
_x += dx; _y += dy;
return *this;
}

private:
int _x, _y;
};

int main()
{
Point pt; // 初始化为 (0, 0)
pt( 3, 2 ); // 这他妈不是函数……
}