Retro C++ quiz #58
Given the following in C++:
int main() {
int arr[10][20]{};
auto x = arr[1,2] ;
}
Without checking the type of x is:
A. int
B. int*
C. Depends on standard version
D. The initialization is Ill-formed
A
B
C
D
Poll ended at .
Retro C++ quiz #58
Given the following in C++:
int main() {
int arr[10][20]{};
auto x = arr[1,2] ;
}
Without checking the type of x is:
A. int
B. int*
C. Depends on standard version
D. The initialization is Ill-formed
@morenonatural @shafik I know that we got the possibility to write [i,j] *overloads* for operator[] with a recent-ish standard, but I'm not sure if it got implemented for the built-in array types.
EDIT: It was added in C++23 in https://wg21.link/P2128 and only concerns overloads for user-defined types, not built-in arrays. Unless there was another paper that also did the change to built-in arrays.