
on Fri Aug 26 2011, Larry Evans <cppljevans-AT-suddenlink.net> wrote:
Since an n-dimensional array can be thought of as a function of n indexes, I would think then that subscripting multi-dimensional arrays would rub you the wrong way:
int f[1][1][1];
f[0] => doesn't return an int f[0][0] => doesn't return an int f[0][0][0] => *does* return an int
Instead, would you prefer the following symmetrical version?
f[0] => doesn't return an int f[0][0] => doesn't return an int f[0][0][0] => doesn't return an int f[0][0][0]() => *does* return an int
No, sorry, but that's just silly. Array indexing is entirely consistent: f[0] => returns int(&)[1][1] f[0][0] => returns int(&)[1] f[0][0][0] => returns int& -- Dave Abrahams BoostPro Computing http://www.boostpro.com