有何不同?
为何以下两个操作符重载
第一个为Point& Point::operator++()
第二个为Point Point::operator++(int)
为什么第一个Point后面跟& 而第二个Point后面没有呢?
// Define prefix increment operator.
Point& Point::operator++()
{
_x++;
_y++;
return *this;
}
// Define postfix increment operator.
Point Point::operator++(int)
{
Point temp = *this;
++*this;
return temp;
}