Does an array of a value type and a structure containing only that type
have the same alignment requirements? That is, in C-syntax:
float* array;
struct point { float x; float y; }
point p;
array = (float*)&p;
Does `array[0]` now refer to x, and `array[1]` to y?
I'm creating these structures in LLVM with default packing
(StructType::isPacked == false). I have a library that takes simple
arrays for point structs (OpenGL) and would like to layer nicer types on
top. I'm reasonably certain the above holds true, but want to
double-check that it's guaranteed.
I'd also be doing this type of operation to refer to a list of points:
point* p = ...;
array = (float*)p;