41 #ifndef PB_DS_MASK_BASED_RANGE_HASHING_HPP 42 #define PB_DS_MASK_BASED_RANGE_HASHING_HPP 49 template<
typename Size_Type>
53 typedef Size_Type size_type;
57 { std::swap(m_mask, other.m_mask); }
60 notify_resized(size_type size);
63 range_hash(size_type hash)
const 64 {
return size_type(hash & m_mask); }
68 const static size_type s_num_bits_in_size_type;
69 const static size_type s_highest_bit_1;
72 template<
typename Size_Type>
73 const typename mask_based_range_hashing<Size_Type>::size_type
75 sizeof(
typename mask_based_range_hashing<Size_Type>::size_type) << 3;
77 template<
typename Size_Type>
81 template<
typename Size_Type>
87 while (size ^ s_highest_bit_1)
95 while (i++ < s_num_bits_in_size_type)
96 m_mask = (m_mask << 1) ^ 1;
GNU extensions for policy-based data structures for public use.