---
name: "__gnu_debug::_Safe_unordered_container_base"
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_debug::_Safe_unordered_container_base/3cxx"
---

# \_\_gnu\_debug::\_Safe\_unordered\_container\_base(3cxx)

Base class that supports tracking of local iterators that reference an unordered container.

## NAME

\_\_gnu\_debug::\_Safe\_unordered\_container\_base - Base class that supports tracking of local iterators that reference an unordered container.

## SYNOPSIS

`#include <safe_unordered_base.h>`

Inherits **\_\_gnu\_debug::\_Safe\_sequence\_base**.

Inherited by **\_\_gnu\_debug::\_Safe\_unordered\_container\< \_Container \>**.

### Public Attributes

**\_Safe\_iterator\_base** \* **\_M\_const\_iterators**\
 The list of constant iterators that reference this container.  **\_Safe\_iterator\_base** \* **\_M\_const\_local\_iterators**\
 The list of constant local iterators that reference this container.  **\_Safe\_iterator\_base** \* **\_M\_iterators**\
 The list of mutable iterators that reference this container.  **\_Safe\_iterator\_base** \* **\_M\_local\_iterators**\
 The list of mutable local iterators that reference this container.  unsigned int **\_M\_version**\
 The container version number. This number may never be 0.

### Protected Member Functions

**\_Safe\_unordered\_container\_base** (**\_Safe\_unordered\_container\_base** &&\_\_x) noexcept\
 **\_Safe\_unordered\_container\_base** (const **\_Safe\_unordered\_container\_base** &) noexcept\
 **~\_Safe\_unordered\_container\_base** () noexcept\
 void **\_M\_detach\_all** ()\
 void **\_M\_detach\_singular** ()\
 \_\_gnu\_cxx::\_\_mutex & **\_M\_get\_mutex** ()  throw ()\
 void **\_M\_invalidate\_all** () const\
 void **\_M\_revalidate\_singular** ()\
 void **\_M\_swap** (**\_Safe\_sequence\_base** &\_\_x) noexcept\
 void **\_M\_swap** (**\_Safe\_unordered\_container\_base** &\_\_x) noexcept\

### Friends

class **\_Safe\_local\_iterator\_base**\

## Detailed Description

Base class that supports tracking of local iterators that reference an unordered container.

The \_Safe\_unordered\_container\_base class provides basic support for tracking iterators into an unordered container. Containers that track iterators must derived from \_Safe\_unordered\_container\_base publicly, so that safe iterators (which inherit \_Safe\_iterator\_base) can attach to them. This class contains four linked lists of iterators, one for constant iterators, one for mutable iterators, one for constant local iterators, one for mutable local iterators and a version number that allows very fast invalidation of all iterators that reference the container.

This class must ensure that no operation on it may throw an exception, otherwise *safe* containers may fail to provide the exception-safety guarantees required by the C++ standard.

## Constructor & Destructor Documentation

### \_\_gnu\_debug::\_Safe\_unordered\_container\_base::~\_Safe\_unordered\_container\_base ()` [inline]`, ` [protected]`, ` [noexcept]`

Notify all iterators that reference this container that the container is being destroyed.

## Member Function Documentation

### void \_\_gnu\_debug::\_Safe\_unordered\_container\_base::\_M\_detach\_all ()` [protected]`

Detach all iterators, leaving them singular.

### void \_\_gnu\_debug::\_Safe\_sequence\_base::\_M\_detach\_singular ()` [protected]`, ` [inherited]`

Detach all singular iterators.

**Postcondition**

for all iterators i attached to this sequence, i-\>\_M\_version == \_M\_version.

### \_\_gnu\_cxx::\_\_mutex & \_\_gnu\_debug::\_Safe\_sequence\_base::\_M\_get\_mutex ()` [protected]`, ` [inherited]`

For use in \_Safe\_sequence.

Referenced by **\_\_gnu\_debug::\_Safe\_sequence\< \_Sequence \>::\_M\_transfer\_from\_if()**.

### void \_\_gnu\_debug::\_Safe\_sequence\_base::\_M\_invalidate\_all () const` [inline]`, ` [protected]`, ` [inherited]`

Invalidates all iterators.

References **\_\_gnu\_debug::\_Safe\_sequence\_base::\_M\_version**.

### void \_\_gnu\_debug::\_Safe\_sequence\_base::\_M\_revalidate\_singular ()` [protected]`, ` [inherited]`

Revalidates all attached singular iterators. This method may be used to validate iterators that were invalidated before (but for some reason, such as an exception, need to become valid again).

### void \_\_gnu\_debug::\_Safe\_sequence\_base::\_M\_swap (\_Safe\_sequence\_base & \_\_x)` [protected]`, ` [noexcept]`, ` [inherited]`

Swap this sequence with the given sequence. This operation also swaps ownership of the iterators, so that when the operation is complete all iterators that originally referenced one container now reference the other container.

### void \_\_gnu\_debug::\_Safe\_unordered\_container\_base::\_M\_swap (\_Safe\_unordered\_container\_base & \_\_x)` [protected]`, ` [noexcept]`

Swap this container with the given container. This operation also swaps ownership of the iterators, so that when the operation is complete all iterators that originally referenced one container now reference the other container.

## Member Data Documentation

### \_Safe\_iterator\_base\* \_\_gnu\_debug::\_Safe\_sequence\_base::\_M\_const\_iterators` [inherited]`

The list of constant iterators that reference this container.

Referenced by **\_\_gnu\_debug::\_Safe\_sequence\< \_Sequence \>::\_M\_transfer\_from\_if()**.

### \_Safe\_iterator\_base\* \_\_gnu\_debug::\_Safe\_unordered\_container\_base::\_M\_const\_local\_iterators

The list of constant local iterators that reference this container.

### \_Safe\_iterator\_base\* \_\_gnu\_debug::\_Safe\_sequence\_base::\_M\_iterators` [inherited]`

The list of mutable iterators that reference this container.

Referenced by **\_\_gnu\_debug::\_Safe\_sequence\< \_Sequence \>::\_M\_transfer\_from\_if()**.

### \_Safe\_iterator\_base\* \_\_gnu\_debug::\_Safe\_unordered\_container\_base::\_M\_local\_iterators

The list of mutable local iterators that reference this container.

### unsigned int \_\_gnu\_debug::\_Safe\_sequence\_base::\_M\_version` [mutable]`, ` [inherited]`

The container version number. This number may never be 0.

Referenced by **\_\_gnu\_debug::\_Safe\_sequence\_base::\_M\_invalidate\_all()**, and **\_\_gnu\_debug::\_Safe\_local\_iterator\< \_Iterator, \_Sequence \>::operator=()**.

## Author

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