---
name: "__gnu_pbds::hash_prime_size_policy"
section: "3"
platform: "linux"
package: "gcc"
version: "16.2.1+r23+gd564253eb6c8-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/__gnu_pbds::hash_prime_size_policy"
---

# \_\_gnu\_pbds::hash\_prime\_size\_policy(3)

A size policy whose sequence of sizes form a nearly-exponential sequence of primes.

## NAME

\_\_gnu\_pbds::hash\_prime\_size\_policy - A size policy whose sequence of sizes form a nearly-exponential sequence of primes.

## SYNOPSIS

\#include \<hash\_policy.hpp\>

### Public Types

typedef std::size\_t **size\_type**\
 Size type.

### Public Member Functions

**hash\_prime\_size\_policy** (**size\_type** start\_size=8)\
 Default constructor, or onstructor taking a start\_size The policy will use the sequence of sizes approximately start\_size, start\_size\* 2, start\_size\* 2^2, ...  void **swap** (**hash\_prime\_size\_policy** &other)\

### Protected Member Functions

**size\_type** **get\_nearest\_larger\_size** (**size\_type** size) const\
 **size\_type** **get\_nearest\_smaller\_size** (**size\_type** size) const\

## Detailed Description

A size policy whose sequence of sizes form a nearly-exponential sequence of primes.

## Member Typedef Documentation

### typedef std::size\_t \_\_gnu\_pbds::hash\_prime\_size\_policy::size\_type

Size type.

## Constructor & Destructor Documentation

### \_\_gnu\_pbds::hash\_prime\_size\_policy::hash\_prime\_size\_policy (size\_type start\_size = 8) \[inline\]

Default constructor, or onstructor taking a start\_size The policy will use the sequence of sizes approximately start\_size, start\_size\* 2, start\_size\* 2^2, ...

## Author

Generated automatically by Doxygen for libstdc++ from the source code.
