41 #ifdef PB_DS_CLASS_C_DEC 43 #ifdef _GLIBCXX_SYSHDR 44 #pragma GCC system_header 51 num_distinct_sizes_16_bit = 14,
52 num_distinct_sizes_32_bit = 30,
53 num_distinct_sizes_64_bit = 62,
56 #if __SIZE_WIDTH__ >= 64 57 num_distinct_sizes = num_distinct_sizes_64_bit
58 #elif __SIZE_WIDTH__ >= 32 59 num_distinct_sizes = num_distinct_sizes_32_bit
61 num_distinct_sizes = num_distinct_sizes_16_bit
65 #pragma GCC diagnostic push 66 #pragma GCC diagnostic ignored "-Wlong-long" 69 static const std::size_t g_a_sizes[num_distinct_sizes] =
85 #if __SIZE_WIDTH__ >= 32 102 #if __SIZE_WIDTH__ >= 64 103 (std::size_t)8589934583ull,
104 (std::size_t)17179869143ull,
105 (std::size_t)34359738337ull,
106 (std::size_t)68719476731ull,
107 (std::size_t)137438953447ull,
108 (std::size_t)274877906899ull,
109 (std::size_t)549755813881ull,
110 (std::size_t)1099511627689ull,
111 (std::size_t)2199023255531ull,
112 (std::size_t)4398046511093ull,
113 (std::size_t)8796093022151ull,
114 (std::size_t)17592186044399ull,
115 (std::size_t)35184372088777ull,
116 (std::size_t)70368744177643ull,
117 (std::size_t)140737488355213ull,
118 (std::size_t)281474976710597ull,
119 (std::size_t)562949953421231ull,
120 (std::size_t)1125899906842597ull,
121 (std::size_t)2251799813685119ull,
122 (std::size_t)4503599627370449ull,
123 (std::size_t)9007199254740881ull,
124 (std::size_t)18014398509481951ull,
125 (std::size_t)36028797018963913ull,
126 (std::size_t)72057594037927931ull,
127 (std::size_t)144115188075855859ull,
128 (std::size_t)288230376151711717ull,
129 (std::size_t)576460752303423433ull,
130 (std::size_t)1152921504606846883ull,
131 (std::size_t)2305843009213693951ull,
132 (std::size_t)4611686018427387847ull,
133 (std::size_t)9223372036854775783ull,
134 (std::size_t)18446744073709551557ull,
138 #pragma GCC diagnostic pop 145 hash_prime_size_policy(size_type n) : m_start_size(n)
146 { m_start_size = get_nearest_larger_size(n); }
151 swap(PB_DS_CLASS_C_DEC& other)
152 { std::swap(m_start_size, other.m_start_size); }
155 inline PB_DS_CLASS_C_DEC::size_type
157 get_nearest_larger_size(size_type n)
const 160 detail::g_a_sizes + detail::num_distinct_sizes, n);
162 if (p_upper == detail::g_a_sizes + detail::num_distinct_sizes)
163 __throw_resize_error();
168 inline PB_DS_CLASS_C_DEC::size_type
170 get_nearest_smaller_size(size_type n)
const 173 detail::g_a_sizes + detail::num_distinct_sizes, n);
175 if (*p_lower >= n && p_lower != detail::g_a_sizes)
177 if (*p_lower < m_start_size)
constexpr _ForwardIterator lower_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp &__val)
Finds the first position in which val could be inserted without changing the ordering.
constexpr _ForwardIterator upper_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp &__val, _Compare __comp)
Finds the last position in which __val could be inserted without changing the ordering.