I don't think it's allowed to touch the padding, since the struct is trivially-constructible. But it may or may not be formally UB, I'm not sure (probably harmless in practice). I'm more worried about the structs being misaligned, but I think it should be ok too on most platforms?
↧