## 17.9 Example: Overloading the Subscript Operator (cont.)

>     SafeArray::SafeArray(const int v[], int s) : size(s)
>     {
>        values = new int[size];
>        for (int i = 0; i < size; i++)
>        values[i] = v[i];
>     }

>     int& SafeArray::operator[](int index)
>     {
>        assert((index >= 0) && (index < size));
>        return values[i];
>     }

>     int SafeArray::operator[](int index) const;
>     {
>        assert((index >= 0) && (index < size));
>        return values[i];
>     }

prev |top |next