const Byte& operator++()
{
b++;
return *this;// 前缀形式 返回改变后的对象
}
const Byte& operator--()
{
b--;
return *this;
}
const Byte operator++(int)
{
Byte before(b);
b++;
return before;//后缀形式 返回改变前的对象 创建一个独立的类类返回先前的值 所以采用的是按值进行返回
}
const Byte operator--(int)
{
Byte before(b);
b--;
return before;
}
为什么返回this指针的解引用的时候函数的返回值要定义为类的引用类型呢? 可以直接定义为按值进行返回吗?