Copying the header value using casts had some problems with certain compiler settings

Therefore, std::memcpy is used instead now.