---
name: "__gnu_pbds::hash_standard_resize_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_standard_resize_policy"
---

# \_\_gnu\_pbds::hash\_standard\_resize\_policy(3)

A resize policy which delegates operations to size and trigger policies.

## NAME

\_\_gnu\_pbds::hash\_standard\_resize\_policy\< Size\_Policy, Trigger\_Policy, External\_Size\_Access, Size\_Type \> - A resize policy which delegates operations to size and trigger policies.

## SYNOPSIS

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

Inherits **\_\_gnu\_pbds::hash\_exponential\_size\_policy\< Size\_Type \>**, and **\_\_gnu\_pbds::hash\_load\_check\_resize\_trigger\< External\_Load\_Access, Size\_Type \>**.

### Public Types

enum { **external\_load\_access** }\
 enum { **external\_size\_access** }\
 typedef Size\_Policy **size\_policy**\
 typedef Size\_Type **size\_type**\
 typedef Trigger\_Policy **trigger\_policy**\

### Public Member Functions

**hash\_standard\_resize\_policy** ()\
 Default constructor.  **hash\_standard\_resize\_policy** (const Size\_Policy &r\_size\_policy)\
 constructor taking some policies r\_size\_policy will be copied by the Size\_Policy object of this object.  **hash\_standard\_resize\_policy** (const Size\_Policy &r\_size\_policy, const Trigger\_Policy &r\_trigger\_policy)\
 constructor taking some policies. r\_size\_policy will be copied by the Size\_Policy object of this object. r\_trigger\_policy will be copied by the Trigger\_Policy object of this object.  size\_type **get\_actual\_size** () const\
 Returns the actual size of the container.  **std::pair**\< float, float \> **get\_loads** () const\
 Returns a pair of the minimal and maximal loads, respectively.  Size\_Policy & **get\_size\_policy** ()\
 Access to the Size\_Policy object used.  const Size\_Policy & **get\_size\_policy** () const\
 Const access to the Size\_Policy object used.  Trigger\_Policy & **get\_trigger\_policy** ()\
 Access to the Trigger\_Policy object used.  const Trigger\_Policy & **get\_trigger\_policy** () const\
 Access to the Trigger\_Policy object used.  void **resize** (size\_type suggested\_new\_size)\
 Resizes the container to suggested\_new\_size, a suggested size (the actual size will be determined by the Size\_Policy object).  void **set\_loads** (**std::pair**\< float, float \> load\_pair)\
 Sets the loads through a pair of the minimal and maximal loads, respectively.  void **swap** (**hash\_exponential\_size\_policy**\< Size\_Type \> &other)\
 void **swap** (**hash\_load\_check\_resize\_trigger** &other)\
 void **swap** (**hash\_standard\_resize\_policy**\< Size\_Policy, Trigger\_Policy, External\_Size\_Access, 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\
 size\_type **get\_new\_size** (size\_type size, size\_type num\_used\_e) const\
 Queries what the new size should be, when the container is resized naturally. The current \_\_size of the container is size, and the number of used entries within the container is num\_used\_e.  bool **is\_grow\_needed** (size\_type size, size\_type num\_entries) const\
 bool **is\_resize\_needed** () const\
 void **notify\_cleared** ()\
 void **notify\_erase\_search\_collision** ()\
 void **notify\_erase\_search\_end** ()\
 void **notify\_erase\_search\_start** ()\
 void **notify\_erased** (size\_type num\_e)\
 void **notify\_externally\_resized** (size\_type new\_size)\
 void **notify\_find\_search\_collision** ()\
 void **notify\_find\_search\_end** ()\
 void **notify\_find\_search\_start** ()\
 void **notify\_insert\_search\_collision** ()\
 void **notify\_insert\_search\_end** ()\
 void **notify\_insert\_search\_start** ()\
 void **notify\_inserted** (size\_type num\_e)\
 void **notify\_resized** (size\_type new\_size)\

## Detailed Description

### template\<typename Size\_Policy = hash\_exponential\_size\_policy\<\>, typename Trigger\_Policy = hash\_load\_check\_resize\_trigger\<\>, bool External\_Size\_Access = false, typename Size\_Type = std::size\_t\>

class \_\_gnu\_pbds::hash\_standard\_resize\_policy\< Size\_Policy, Trigger\_Policy, External\_Size\_Access, Size\_Type \>"A resize policy which delegates operations to size and trigger policies.

## Member Enumeration Documentation

### template\<bool External\_Load\_Access = false, typename Size\_Type = std::size\_t\> anonymous enum \[inherited\]

**Enumerator**

- ***external\_load\_access***

  Specifies whether the load factor can be accessed externally. The two options have different trade-offs in terms of flexibility, genericity, and encapsulation.

## Constructor & Destructor Documentation

### template\<typename Size\_Policy, typename Trigger\_Policy, bool External\_Size\_Access, typename Size\_Type\> \_\_gnu\_pbds::hash\_standard\_resize\_policy\< Size\_Policy, Trigger\_Policy, External\_Size\_Access, Size\_Type \>::hash\_standard\_resize\_policy ()

Default constructor.

### template\<typename Size\_Policy, typename Trigger\_Policy, bool External\_Size\_Access, typename Size\_Type\> \_\_gnu\_pbds::hash\_standard\_resize\_policy\< Size\_Policy, Trigger\_Policy, External\_Size\_Access, Size\_Type \>::hash\_standard\_resize\_policy (const Size\_Policy & r\_size\_policy)

constructor taking some policies r\_size\_policy will be copied by the Size\_Policy object of this object.

### template\<typename Size\_Policy, typename Trigger\_Policy, bool External\_Size\_Access, typename Size\_Type\> \_\_gnu\_pbds::hash\_standard\_resize\_policy\< Size\_Policy, Trigger\_Policy, External\_Size\_Access, Size\_Type \>::hash\_standard\_resize\_policy (const Size\_Policy & r\_size\_policy, const Trigger\_Policy & r\_trigger\_policy)

constructor taking some policies. r\_size\_policy will be copied by the Size\_Policy object of this object. r\_trigger\_policy will be copied by the Trigger\_Policy object of this object.

## Member Function Documentation

### template\<typename Size\_Policy, typename Trigger\_Policy, bool External\_Size\_Access, typename Size\_Type\> hash\_standard\_resize\_policy\< Size\_Policy, Trigger\_Policy, External\_Size\_Access, Size\_Type \>::size\_type \_\_gnu\_pbds::hash\_standard\_resize\_policy\< Size\_Policy, Trigger\_Policy, External\_Size\_Access, Size\_Type \>::get\_actual\_size () const \[inline\]

Returns the actual size of the container.

### template\<bool External\_Load\_Access, typename Size\_Type\> std::pair\< float, float \> \_\_gnu\_pbds::hash\_load\_check\_resize\_trigger\< External\_Load\_Access, Size\_Type \>::get\_loads () const \[inline\], \[inherited\]

Returns a pair of the minimal and maximal loads, respectively.

### template\<typename Size\_Policy, typename Trigger\_Policy, bool External\_Size\_Access, typename Size\_Type\> hash\_standard\_resize\_policy\< Size\_Policy, Trigger\_Policy, External\_Size\_Access, Size\_Type \>::size\_type \_\_gnu\_pbds::hash\_standard\_resize\_policy\< Size\_Policy, Trigger\_Policy, External\_Size\_Access, Size\_Type \>::get\_new\_size (size\_type size, size\_type num\_used\_e) const \[protected\]

Queries what the new size should be, when the container is resized naturally. The current \_\_size of the container is size, and the number of used entries within the container is num\_used\_e.

### template\<typename Size\_Policy, typename Trigger\_Policy, bool External\_Size\_Access, typename Size\_Type\> Size\_Policy & \_\_gnu\_pbds::hash\_standard\_resize\_policy\< Size\_Policy, Trigger\_Policy, External\_Size\_Access, Size\_Type \>::get\_size\_policy ()

Access to the Size\_Policy object used.

### template\<typename Size\_Policy, typename Trigger\_Policy, bool External\_Size\_Access, typename Size\_Type\> const Size\_Policy & \_\_gnu\_pbds::hash\_standard\_resize\_policy\< Size\_Policy, Trigger\_Policy, External\_Size\_Access, Size\_Type \>::get\_size\_policy () const

Const access to the Size\_Policy object used.

### template\<typename Size\_Policy, typename Trigger\_Policy, bool External\_Size\_Access, typename Size\_Type\> Trigger\_Policy & \_\_gnu\_pbds::hash\_standard\_resize\_policy\< Size\_Policy, Trigger\_Policy, External\_Size\_Access, Size\_Type \>::get\_trigger\_policy ()

Access to the Trigger\_Policy object used.

### template\<typename Size\_Policy, typename Trigger\_Policy, bool External\_Size\_Access, typename Size\_Type\> const Trigger\_Policy & \_\_gnu\_pbds::hash\_standard\_resize\_policy\< Size\_Policy, Trigger\_Policy, External\_Size\_Access, Size\_Type \>::get\_trigger\_policy () const

Access to the Trigger\_Policy object used.

### template\<typename Size\_Policy, typename Trigger\_Policy, bool External\_Size\_Access, typename Size\_Type\> void \_\_gnu\_pbds::hash\_standard\_resize\_policy\< Size\_Policy, Trigger\_Policy, External\_Size\_Access, Size\_Type \>::resize (size\_type suggested\_new\_size)

Resizes the container to suggested\_new\_size, a suggested size (the actual size will be determined by the Size\_Policy object).

### template\<bool External\_Load\_Access, typename Size\_Type\> void \_\_gnu\_pbds::hash\_load\_check\_resize\_trigger\< External\_Load\_Access, Size\_Type \>::set\_loads (std::pair\< float, float \> load\_pair) \[inherited\]

Sets the loads through a pair of the minimal and maximal loads, respectively.

## Author

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