The task requires writable indexing and reading through const objects. Find the operator bug.
C++
#include <cstddef>
#include <vector>
class Scores {
std::vector<int> values_{0, 0, 0};
public:
int operator[](std::size_t index) {
return values_.at(index);
}
};
void award_bonus(Scores& scores) {
scores[0] = 10;
}