---
name: "std::__detail::_Power2_rehash_policy"
section: "3cxx"
platform: "linux"
package: "libstdc++-10-doc"
version: "10.2.1-6"
release: "Debian 11 (Bullseye)"
platforms: ["linux"]
url: "https://new.carta.tech/std::__detail::_Power2_rehash_policy"
---

# std::\_\_detail::\_Power2\_rehash\_policy(3cxx)

Rehash policy providing power of 2 bucket numbers. Avoids modulo operations.

## NAME

std::\_\_detail::\_Power2\_rehash\_policy - Rehash policy providing power of 2 bucket numbers. Avoids modulo operations.

## SYNOPSIS

### Public Types

using **\_\_has\_load\_factor** = **true\_type**\
 typedef std::size\_t **\_State**\

### Public Member Functions

**\_Power2\_rehash\_policy** (float \_\_z=1.0) noexcept\
 std::size\_t **\_M\_bkt\_for\_elements** (std::size\_t \_\_n) const noexcept\
 **std::pair**\< bool, std::size\_t \> **\_M\_need\_rehash** (std::size\_t \_\_n\_bkt, std::size\_t \_\_n\_elt, std::size\_t \_\_n\_ins) noexcept\
 std::size\_t **\_M\_next\_bkt** (std::size\_t \_\_n) noexcept\
 void **\_M\_reset** () noexcept\
 void **\_M\_reset** (\_State \_\_state) noexcept\
 \_State **\_M\_state** () const noexcept\
 float **max\_load\_factor** () const noexcept\

### Public Attributes

float **\_M\_max\_load\_factor**\
 std::size\_t **\_M\_next\_resize**\

### Static Public Attributes

static const std::size\_t **\_S\_growth\_factor**\

## Detailed Description

Rehash policy providing power of 2 bucket numbers. Avoids modulo operations.

Definition at line 522 of file hashtable\_policy.h.

## Author

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