Writing to a non-const array index