---
name: "__gnu_pbds::cc_hash_max_collision_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::cc_hash_max_collision_check_resize_trigger/3cxx"
---

# \_\_gnu\_pbds::cc\_hash\_max\_collision\_check\_resize\_trigger(3cxx)

A resize trigger policy based on collision checks. It keeps the simulated load factor lower than some given load factor.

## NAME

\_\_gnu\_pbds::cc\_hash\_max\_collision\_check\_resize\_trigger\< External\_Load\_Access, Size\_Type \> - A resize trigger policy based on collision checks. It keeps the simulated load factor lower than some given load factor.

## SYNOPSIS

`#include <hash_policy.hpp>`

### Public Types

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

### Public Member Functions

**cc\_hash\_max\_collision\_check\_resize\_trigger** (float load=0.5)\
 Default constructor, or constructor taking load, a \_\_load factor which it will attempt to maintain.  float **get\_load** () const\
 Returns the current load.  void **set\_load** (float load)\
 Sets the load; does not resize the container.  void **swap** (**cc\_hash\_max\_collision\_check\_resize\_trigger**\< External\_Load\_Access, Size\_Type \> &other)\

### Protected Member Functions

bool **is\_grow\_needed** (size\_type size, size\_type num\_entries) const\
 Queries whether a grow is needed. This method is called only if this object indicated is needed.  bool **is\_resize\_needed** () const\
 Queries whether a resize is needed.  void **notify\_cleared** ()\
 Notifies the table was cleared.  void **notify\_erase\_search\_collision** ()\
 Notifies a search encountered a collision.  void **notify\_erase\_search\_end** ()\
 Notifies a search ended.  void **notify\_erase\_search\_start** ()\
 Notifies an erase search started.  void **notify\_erased** (size\_type num\_entries)\
 Notifies an element was erased.  void **notify\_externally\_resized** (size\_type new\_size)\
 Notifies the table was resized externally.  void **notify\_find\_search\_collision** ()\
 Notifies a search encountered a collision.  void **notify\_find\_search\_end** ()\
 Notifies a search ended.  void **notify\_find\_search\_start** ()\
 Notifies a find search started.  void **notify\_insert\_search\_collision** ()\
 Notifies a search encountered a collision.  void **notify\_insert\_search\_end** ()\
 Notifies a search ended.  void **notify\_insert\_search\_start** ()\
 Notifies an insert search started.  void **notify\_inserted** (size\_type num\_entries)\
 Notifies an element was inserted.  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::cc\_hash\_max\_collision\_check\_resize\_trigger\< External\_Load\_Access, Size\_Type \>"A resize trigger policy based on collision checks. It keeps the simulated load factor lower than some given load factor.

## 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::cc\_hash\_max\_collision\_check\_resize\_trigger\< External\_Load\_Access, Size\_Type \>::cc\_hash\_max\_collision\_check\_resize\_trigger (float load = `0.5`)

*Default constructor, or constructor taking load, a \_\_load factor which it will attempt to maintain.*

## Member Function Documentation

### template\<bool External\_Load\_Access = false, typename Size\_Type = std::size\_t\> float \_\_gnu\_pbds::cc\_hash\_max\_collision\_check\_resize\_trigger\< External\_Load\_Access, Size\_Type \>::get\_load () const` [inline]`

*Returns the current load.*

### template\<bool External\_Load\_Access = false, typename Size\_Type = std::size\_t\> bool \_\_gnu\_pbds::cc\_hash\_max\_collision\_check\_resize\_trigger\< External\_Load\_Access, Size\_Type \>::is\_grow\_needed (size\_type size, size\_type num\_entries) const` [inline]`, ` [protected]`

*Queries whether a grow is needed. This method is called only if this object indicated is needed.*

### template\<bool External\_Load\_Access = false, typename Size\_Type = std::size\_t\> bool \_\_gnu\_pbds::cc\_hash\_max\_collision\_check\_resize\_trigger\< External\_Load\_Access, Size\_Type \>::is\_resize\_needed () const` [inline]`, ` [protected]`

*Queries whether a resize is needed.*

### template\<bool External\_Load\_Access = false, typename Size\_Type = std::size\_t\> void \_\_gnu\_pbds::cc\_hash\_max\_collision\_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::cc\_hash\_max\_collision\_check\_resize\_trigger\< External\_Load\_Access, Size\_Type \>::notify\_erase\_search\_collision ()` [inline]`, ` [protected]`

*Notifies a search encountered a collision.*

### template\<bool External\_Load\_Access = false, typename Size\_Type = std::size\_t\> void \_\_gnu\_pbds::cc\_hash\_max\_collision\_check\_resize\_trigger\< External\_Load\_Access, Size\_Type \>::notify\_erase\_search\_end ()` [inline]`, ` [protected]`

*Notifies a search ended.*

### template\<bool External\_Load\_Access = false, typename Size\_Type = std::size\_t\> void \_\_gnu\_pbds::cc\_hash\_max\_collision\_check\_resize\_trigger\< External\_Load\_Access, Size\_Type \>::notify\_erase\_search\_start ()` [inline]`, ` [protected]`

*Notifies an erase search started.*

### template\<bool External\_Load\_Access = false, typename Size\_Type = std::size\_t\> void \_\_gnu\_pbds::cc\_hash\_max\_collision\_check\_resize\_trigger\< External\_Load\_Access, Size\_Type \>::notify\_erased (size\_type num\_entries)` [inline]`, ` [protected]`

*Notifies an element was erased.*

### template\<bool External\_Load\_Access = false, typename Size\_Type = std::size\_t\> void \_\_gnu\_pbds::cc\_hash\_max\_collision\_check\_resize\_trigger\< External\_Load\_Access, Size\_Type \>::notify\_externally\_resized (size\_type new\_size)` [protected]`

*Notifies the table was resized externally.*

### template\<bool External\_Load\_Access = false, typename Size\_Type = std::size\_t\> void \_\_gnu\_pbds::cc\_hash\_max\_collision\_check\_resize\_trigger\< External\_Load\_Access, Size\_Type \>::notify\_find\_search\_collision ()` [inline]`, ` [protected]`

*Notifies a search encountered a collision.*

### template\<bool External\_Load\_Access = false, typename Size\_Type = std::size\_t\> void \_\_gnu\_pbds::cc\_hash\_max\_collision\_check\_resize\_trigger\< External\_Load\_Access, Size\_Type \>::notify\_find\_search\_end ()` [inline]`, ` [protected]`

*Notifies a search ended.*

### template\<bool External\_Load\_Access = false, typename Size\_Type = std::size\_t\> void \_\_gnu\_pbds::cc\_hash\_max\_collision\_check\_resize\_trigger\< External\_Load\_Access, Size\_Type \>::notify\_find\_search\_start ()` [inline]`, ` [protected]`

*Notifies a find search started.*

### template\<bool External\_Load\_Access = false, typename Size\_Type = std::size\_t\> void \_\_gnu\_pbds::cc\_hash\_max\_collision\_check\_resize\_trigger\< External\_Load\_Access, Size\_Type \>::notify\_insert\_search\_collision ()` [inline]`, ` [protected]`

*Notifies a search encountered a collision.*

### template\<bool External\_Load\_Access = false, typename Size\_Type = std::size\_t\> void \_\_gnu\_pbds::cc\_hash\_max\_collision\_check\_resize\_trigger\< External\_Load\_Access, Size\_Type \>::notify\_insert\_search\_end ()` [inline]`, ` [protected]`

*Notifies a search ended.*

### template\<bool External\_Load\_Access = false, typename Size\_Type = std::size\_t\> void \_\_gnu\_pbds::cc\_hash\_max\_collision\_check\_resize\_trigger\< External\_Load\_Access, Size\_Type \>::notify\_insert\_search\_start ()` [inline]`, ` [protected]`

*Notifies an insert search started.*

### template\<bool External\_Load\_Access = false, typename Size\_Type = std::size\_t\> void \_\_gnu\_pbds::cc\_hash\_max\_collision\_check\_resize\_trigger\< External\_Load\_Access, Size\_Type \>::notify\_inserted (size\_type num\_entries)` [inline]`, ` [protected]`

*Notifies an element was inserted.*

### template\<bool External\_Load\_Access = false, typename Size\_Type = std::size\_t\> void \_\_gnu\_pbds::cc\_hash\_max\_collision\_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::cc\_hash\_max\_collision\_check\_resize\_trigger\< External\_Load\_Access, Size\_Type \>::set\_load (float load)

*Sets the load; does not resize the container.*

## Author

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