I thought that the standard provided me a function to find the 1st element of a struct. I can't seem to find that though.
I'm scared of alignment: I don't think it's legal to reinterpret_cast
into the 1st element of a struct is it?
So for example given struct { int first, int second } foo
; how would I get the address of the 1st element in foo
, if I didn't know that first
is laid out as the 1st element? (Meaning that &foo.first
is not a valid solution.)