重载中碰到的左值和右值问题

double & Student::operator[ ] (int i) {         return scores[i];  } double Student::operator[ ] (int i)const {         return scores[i]; } 对于 Student 的实例 stu 而言,stu[i]在第一个版本中能够为左值,而在第二个版本中只能为右值。 具体的例
相关文章
相关标签/搜索