Is it possible to pass raw table to function by value? I believe that it's impossible, but I'm looking for official sources to confirm that.
I know how to pass table by reference:
template<typename T, size_t N, size_t M>
void first_example(T (&table_in_function)[N][M]) {
//...
}
//...
int a[50][20];
//...
first_example(a);
or by std::array, but as I sad, I'm looking for solution for raw tables. Simple idea, remove &
, is obviously wrong. Also I am not looking for something like:
template<typename T, size_t N, size_t M>
void third_example(T (&temp_ref)[N][M]) {
T local_table[N][M];
//...
}
I accept solutions like magic code and meta-programming.