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

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

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 = hash\_exponential\_size\_policy\<\>, typename Trigger\_Policy = hash\_load\_check\_resize\_trigger\<\>, bool External\_Size\_Access = false, typename Size\_Type = std::size\_t\> \_\_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 = hash\_exponential\_size\_policy\<\>, typename Trigger\_Policy = hash\_load\_check\_resize\_trigger\<\>, bool External\_Size\_Access = false, typename Size\_Type = std::size\_t\> \_\_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 = hash\_exponential\_size\_policy\<\>, typename Trigger\_Policy = hash\_load\_check\_resize\_trigger\<\>, bool External\_Size\_Access = false, typename Size\_Type = std::size\_t\> \_\_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 = hash\_exponential\_size\_policy\<\>, typename Trigger\_Policy = hash\_load\_check\_resize\_trigger\<\>, bool External\_Size\_Access = false, typename Size\_Type = std::size\_t\> 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 = false, typename Size\_Type = std::size\_t\> 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 = hash\_exponential\_size\_policy\<\>, typename Trigger\_Policy = hash\_load\_check\_resize\_trigger\<\>, bool External\_Size\_Access = false, typename Size\_Type = std::size\_t\> 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 = hash\_exponential\_size\_policy\<\>, typename Trigger\_Policy = hash\_load\_check\_resize\_trigger\<\>, bool External\_Size\_Access = false, typename Size\_Type = std::size\_t\> 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 = hash\_exponential\_size\_policy\<\>, typename Trigger\_Policy = hash\_load\_check\_resize\_trigger\<\>, bool External\_Size\_Access = false, typename Size\_Type = std::size\_t\> 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 = hash\_exponential\_size\_policy\<\>, typename Trigger\_Policy = hash\_load\_check\_resize\_trigger\<\>, bool External\_Size\_Access = false, typename Size\_Type = std::size\_t\> 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 = hash\_exponential\_size\_policy\<\>, typename Trigger\_Policy = hash\_load\_check\_resize\_trigger\<\>, bool External\_Size\_Access = false, typename Size\_Type = std::size\_t\> 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 = hash\_exponential\_size\_policy\<\>, typename Trigger\_Policy = hash\_load\_check\_resize\_trigger\<\>, bool External\_Size\_Access = false, typename Size\_Type = std::size\_t\> 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 = false, typename Size\_Type = std::size\_t\> 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.*
