Skip to content

Commit

Permalink
Fixed strict aliasing violation.
Browse files Browse the repository at this point in the history
Changed C-style cast and dereference to std::memcpy.  Exactly mirrors other code already in the file.
  • Loading branch information
aligature authored and danieljames committed Jan 5, 2015
1 parent 770e4de commit d5dc503
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/boost/functional/hash/detail/hash_float.hpp
Expand Up @@ -68,7 +68,7 @@ namespace boost
std::size_t seed = 0;

if (length >= sizeof(std::size_t)) {
seed = *(std::size_t*) ptr;
std::memcpy(&seed, ptr, sizeof(std::size_t));
length -= sizeof(std::size_t);
ptr += sizeof(std::size_t);

Expand Down

0 comments on commit d5dc503

Please sign in to comment.