uint data1;
ushort data2;
ushort data3;
uchar data4[8];
std::uint8_t buff[16];
std::uint8_t* out = buff;
out = std::copy_n(reinterpret_cast<std::uint8_t*>(&quid.data1), 4, out);
out = std::copy_n(reinterpret_cast<std::uint8_t*>(&quid.data2), 2, out);
out = std::copy_n(reinterpret_cast<std::uint8_t*>(&quid.data3), 2, out);
std::copy_n(quid.data4, 8, out);
out
を使用しないと結果が異なるのはなぜreinterpret_cast
ですか?