Function Set.rehash

Sets the number of buckets in the container to at least n and rearranges all the elements according to their hash values.

void rehash (
  size_t n
);

If n is greater than the current bucketCount and lower than or equal to maxBucketCount, a rehash is forced.

If n is greater than maxBucketCount, maxBucketCount is used instead as a new number of buckets.

If n is less than or equal to the current bucketCount, the function may have no effect.

Rehashing is automatically performed whenever the container needs space to insert new elements.

Parameters

NameDescription
n Minimum number of buckets.