---
name: "__gnu_pbds::hash_load_check_resize_trigger"
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_load_check_resize_trigger/3cxx"
---

# \_\_gnu\_pbds::hash\_load\_check\_resize\_trigger(3cxx)

A resize trigger policy based on a load check. It keeps the load factor between some load factors load\_min and load\_max.

## NAME

\_\_gnu\_pbds::hash\_load\_check\_resize\_trigger\< External\_Load\_Access, Size\_Type \> - A resize trigger policy based on a load check. It keeps the load factor between some load factors load\_min and load\_max.

## SYNOPSIS

`#include <hash_policy.hpp>`

Inherits **\_\_gnu\_pbds::detail::hash\_load\_check\_resize\_trigger\_size\_base\< Size\_Type, Hold\_Size \>**.

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

### Public Types

enum { **external\_load\_access** }\
 typedef Size\_Type **size\_type**\

### Public Member Functions

**hash\_load\_check\_resize\_trigger** (float load\_min=0.125, float load\_max=0.5)\
 Default constructor, or constructor taking load\_min and load\_max load factors between which this policy will keep the actual load.  **std::pair**\< float, float \> **get\_loads** () const\
 Returns a pair of the minimal and maximal loads, respectively.  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\_load\_check\_resize\_trigger** &other)\

### Protected Member Functions

bool **is\_grow\_needed** (size\_type size, size\_type num\_entries) const\
 bool **is\_resize\_needed** () const\
 void **notify\_cleared** ()\
 Notifies the table was cleared.  void **notify\_erase\_search\_collision** ()\
 void **notify\_erase\_search\_end** ()\
 void **notify\_erase\_search\_start** ()\
 void **notify\_erased** (size\_type num\_entries)\
 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\_entries)\
 Notifies an element was inserted. The total number of entries in the table is num\_entries.  void **notify\_resized** (size\_type new\_size)\
 Notifies the table was resized as a result of this object's signifying that a resize is needed.

## Detailed Description

### template\<bool External\_Load\_Access = false, typename Size\_Type = std::size\_t\>

class \_\_gnu\_pbds::hash\_load\_check\_resize\_trigger\< External\_Load\_Access, Size\_Type \>"A resize trigger policy based on a load check. It keeps the load factor between some load factors load\_min and load\_max.

## Member Enumeration Documentation

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

**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\<bool External\_Load\_Access = false, typename Size\_Type = std::size\_t\> \_\_gnu\_pbds::hash\_load\_check\_resize\_trigger\< External\_Load\_Access, Size\_Type \>::hash\_load\_check\_resize\_trigger (float load\_min = `0.125`, float load\_max = `0.5`)

*Default constructor, or constructor taking load\_min and load\_max load factors between which this policy will keep the actual load.*

## Member Function Documentation

### 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]`

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

### 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 \>::notify\_cleared ()` [protected]`

*Notifies the table was cleared.*

### 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 \>::notify\_inserted (size\_type num\_entries)` [inline]`, ` [protected]`

*Notifies an element was inserted. The total number of entries in the table is num\_entries.*

### 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 \>::notify\_resized (size\_type new\_size)` [protected]`

*Notifies the table was resized as a result of this object's signifying that a resize is needed.*

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

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

## Author

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