mirror of
https://github.com/boostorg/functional.git
synced 2025-08-03 14:34:32 +02:00
Fixed strict aliasing violation.
Changed C-style cast and dereference to std::memcpy. Exactly mirrors other code already in the file.
This commit is contained in:
committed by
Daniel James
parent
770e4dea08
commit
d5dc5033d2
@@ -68,7 +68,7 @@ namespace boost
|
|||||||
std::size_t seed = 0;
|
std::size_t seed = 0;
|
||||||
|
|
||||||
if (length >= sizeof(std::size_t)) {
|
if (length >= sizeof(std::size_t)) {
|
||||||
seed = *(std::size_t*) ptr;
|
std::memcpy(&seed, ptr, sizeof(std::size_t));
|
||||||
length -= sizeof(std::size_t);
|
length -= sizeof(std::size_t);
|
||||||
ptr += sizeof(std::size_t);
|
ptr += sizeof(std::size_t);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user