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

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

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\< std::size\_t, false \>**.

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, typename Size\_Type\> \_\_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, typename Size\_Type\> 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, typename Size\_Type\> 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, typename Size\_Type\> 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, typename Size\_Type\> 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.

References **notify\_resized()**.

Referenced by **notify\_resized()**.

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

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

## Author

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