Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <x86intrin.h>
- struct phash
- {
- std::size_t
- operator () (std::intptr_t const _offset) const noexcept
- {
- #if defined(__x86_64__)
- return _mm_crc32_u64(0, static_cast< std::uintptr_t >(_offset));
- #elif defined(__i386__)
- return _mm_crc32_u32(0, static_cast< std::uintptr_t >(_offset));
- #endif
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment