Why would you pass a pointer instead of a reference if you're just going to cast it to a reference? |
You will be casting to a reference to use it, after you have done whatever you need to with it as a pointer. If you don't need it as a pointer, then pass a reference.
Two reasons for passing via pointer off the top of my head
1) The function accepts a no-data, which is different to a default constructed object.
2) The function wants to take over (or be involved in) the memory management of the argument.
Given that you have either of these situations, or any other where passing via pointer is better, you may still want to cast to a reference to use the object.
I admit I had neglected to consider (*x)[i], in my head I was thinking x->operator[](y), which is why I think the syntax is awful, and almost always cast to reference. However, even considering your syntax, I still think casting to a reference is better as it is much much easier to read without having the (* ) everywhere, but that is just preference I guess.