Fix constness of array.d

Thanks to @aG0aep6G this works as far as I can see.
Yeah, it's also a little confusing from a readability perspective.

I really wish this type didn't have to be a template to solve this problem, but I don't know of any solutions myself...