---
name: "__gnu_pbds::hash_prime_size_policy"
section: "3cxx"
platform: "linux"
package: "libstdc++-12-doc"
version: "12.4.0-5"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/__gnu_pbds::hash_prime_size_policy/3cxx"
---

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

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`)

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.
