Is type punning arrays of the same type but with a different size still a violation of strict aliasing?
int arr[4];
int(&ref)[2] = reinterpret_cast<int(&)[2]>(arr);
arr[0] = 0; //write to original
ref[0]; //read from pun
Is type punning arrays of the same type but with a different size still a violation of strict aliasing?
int arr[4];
int(&ref)[2] = reinterpret_cast<int(&)[2]>(arr);
arr[0] = 0; //write to original
ref[0]; //read from pun