Following my question about passing array as const argument, I am trying to figure out how to write a method where the argument is a const array of fixed size const array. The only writable thing would be the content of these arrays.
I am thinking about something like this:
template <size_t N>
void myMethod(int* const (&inTab)[N])
{
inTab = 0; // this won't compile
inTab[0] = 0; // this won't compile
inTab[0][0] = 0; // this will compile
}
The only problem in this solution is that we don't know the first dimension. Does anyone have a solution for this?
Thanks in advance,
Kevin
[Edit]
I don't want to use std::vector or such dynamically allocated arrays.