@@ -190,35 +190,35 @@ class small_mapt
190
190
static_assert (S_BITS <= N_BITS, " S_BITS should be no larger than N_BITS" );
191
191
192
192
static_assert (
193
- std::numeric_limits<unsigned >::digits >= BITS,
193
+ std::numeric_limits<std:: size_t >::digits >= BITS,
194
194
" BITS must fit into an unsigned" );
195
195
196
196
// Internal
197
197
198
- unsigned get_field (std::size_t field) const
198
+ std:: size_t get_field (std::size_t field) const
199
199
{
200
200
PRECONDITION (field < NUM);
201
201
202
- unsigned shift = field * BITS;
202
+ std:: size_t shift = field * BITS;
203
203
return (ind & (MASK << shift)) >> shift;
204
204
}
205
205
206
- void set_field (std::size_t field, unsigned v)
206
+ void set_field (std::size_t field, std:: size_t v)
207
207
{
208
208
PRECONDITION (field < NUM);
209
209
PRECONDITION ((std::size_t )(v >> 1 ) < NUM);
210
210
211
- unsigned shift = field * BITS;
211
+ std:: size_t shift = field * BITS;
212
212
213
213
ind &= ~((index_fieldt)MASK << shift);
214
- ind |= v << shift;
214
+ ind |= (index_fieldt) v << shift;
215
215
}
216
216
217
217
void shift_indices (std::size_t ii)
218
218
{
219
219
for (std::size_t idx = 0 ; idx < S_BITS / BITS; idx++)
220
220
{
221
- unsigned v = get_field (idx);
221
+ std:: size_t v = get_field (idx);
222
222
if (v & 1 )
223
223
{
224
224
v >>= 1 ;
@@ -234,7 +234,7 @@ class small_mapt
234
234
public:
235
235
// Standard const iterator
236
236
237
- typedef std::pair<const unsigned , const T &> value_type ;
237
+ typedef std::pair<const std:: size_t , const T &> valuet ;
238
238
239
239
// / Const iterator
240
240
// /
@@ -255,14 +255,14 @@ class small_mapt
255
255
{
256
256
}
257
257
258
- const value_type operator *() const
258
+ const valuet operator *() const
259
259
{
260
- return value_type (idx, *(m.p + ii));
260
+ return valuet (idx, *(m.p + ii));
261
261
}
262
262
263
- const std::shared_ptr<value_type > operator ->() const
263
+ const std::shared_ptr<valuet > operator ->() const
264
264
{
265
- return std::make_shared<value_type >(idx, *(m.p + ii));
265
+ return std::make_shared<valuet >(idx, *(m.p + ii));
266
266
}
267
267
268
268
const_iterator operator ++()
@@ -299,7 +299,7 @@ class small_mapt
299
299
{
300
300
while (idx < NUM)
301
301
{
302
- unsigned v = m.get_field (idx);
302
+ std:: size_t v = m.get_field (idx);
303
303
if (v & 1 )
304
304
{
305
305
ii = v >> 1 ;
@@ -394,7 +394,7 @@ class small_mapt
394
394
{
395
395
PRECONDITION (idx < NUM);
396
396
397
- unsigned v = get_field (idx);
397
+ std:: size_t v = get_field (idx);
398
398
if (v & 1 )
399
399
{
400
400
std::size_t ii = v >> 1 ;
@@ -415,7 +415,7 @@ class small_mapt
415
415
{
416
416
PRECONDITION (idx < NUM);
417
417
418
- unsigned v = get_field (idx);
418
+ std:: size_t v = get_field (idx);
419
419
if (v & 1 )
420
420
{
421
421
std::size_t ii = v >> 1 ;
@@ -429,7 +429,7 @@ class small_mapt
429
429
{
430
430
PRECONDITION (idx < NUM);
431
431
432
- unsigned v = get_field (idx);
432
+ std:: size_t v = get_field (idx);
433
433
434
434
if (v & 1 )
435
435
{
@@ -466,7 +466,7 @@ class small_mapt
466
466
{
467
467
PRECONDITION (idx < NUM);
468
468
469
- unsigned v = get_field (idx);
469
+ std:: size_t v = get_field (idx);
470
470
INVARIANT (v & 1 , " element must be in map" );
471
471
472
472
std::size_t ii = v >> 1 ;
@@ -500,7 +500,7 @@ class small_mapt
500
500
{
501
501
PRECONDITION (idx < NUM);
502
502
503
- unsigned v = get_field (idx);
503
+ std:: size_t v = get_field (idx);
504
504
INVARIANT (!(v & 1 ), " element must not be in map" );
505
505
506
506
std::size_t n = size ();
0 commit comments