I do not understand why we usually need two versions of functions that return reference - one const and the other not.
For example in this code:

```
const char& String::operator[](int index) const {
    verify_index(index);
    return data[index];
}

char& String::operator[](int index) {
    verify_index(index);
    return data[index];
}

```

if we only had const, then we wouldn't be able to do for example str[i] = value. But what is the problem with only having non-const reference, can someone please give an example?

Thanks