---
name: "__gnu_pbds::hash_exponential_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_exponential_size_policy/3cxx"
---

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

A size policy whose sequence of sizes form an exponential sequence (typically powers of 2.

## NAME

\_\_gnu\_pbds::hash\_exponential\_size\_policy\< Size\_Type \> - A size policy whose sequence of sizes form an exponential sequence (typically powers of 2.

## SYNOPSIS

`#include <hash_policy.hpp>`

Inherited by **\_\_gnu\_pbds::hash\_standard\_resize\_policy\< Size\_Policy, Trigger\_Policy, External\_Size\_Access, Size\_Type \>**.

### Public Types

typedef Size\_Type **size\_type**\

### Public Member Functions

**hash\_exponential\_size\_policy** (size\_type start\_size=8, size\_type grow\_factor=2)\
 Default constructor, or onstructor taking a start\_size, or constructor taking a start size and grow\_factor. The policy will use the sequence of sizes start\_size, start\_size\* grow\_factor, start\_size\* grow\_factor^2, ...  void **swap** (**hash\_exponential\_size\_policy**\< Size\_Type \> &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

### template\<typename Size\_Type = std::size\_t\>

class \_\_gnu\_pbds::hash\_exponential\_size\_policy\< Size\_Type \>"A size policy whose sequence of sizes form an exponential sequence (typically powers of 2.

## Constructor & Destructor Documentation

### template\<typename Size\_Type = std::size\_t\> \_\_gnu\_pbds::hash\_exponential\_size\_policy\< Size\_Type \>::hash\_exponential\_size\_policy (size\_type start\_size = `8`, size\_type grow\_factor = `2`)

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

## Author

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