---
name: "__gnu_debug::_Safe_forward_list"
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_forward_list/3cxx"
---

# \_\_gnu\_debug::\_Safe\_forward\_list(3cxx)

Special iterators swap and invalidation for forward\_list because of the before\_begin iterator.

## NAME

\_\_gnu\_debug::\_Safe\_forward\_list\< \_SafeSequence \> - Special iterators swap and invalidation for forward\_list because of the before\_begin iterator.

## SYNOPSIS

`#include <forward_list>`

Inherits **\_\_gnu\_debug::\_Safe\_sequence\< \_SafeSequence \>**.

### Public Member Functions

void **\_M\_invalidate\_if** (\_Predicate \_\_pred)\
 void **\_M\_transfer\_from\_if** (**\_Safe\_sequence** &\_\_from, \_Predicate \_\_pred)\

### Public Attributes

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

### Protected Member Functions

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

## Detailed Description

### template\<typename \_SafeSequence\>

class \_\_gnu\_debug::\_Safe\_forward\_list\< \_SafeSequence \>"Special iterators swap and invalidation for forward\_list because of the before\_begin iterator.

## Member Function Documentation

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

Detach all iterators, leaving them singular.

Referenced by **\_\_gnu\_debug::\_Safe\_sequence\_base::~\_Safe\_sequence\_base()**.

### 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\< \_SafeSequence \>::\_M\_invalidate\_if (\_Predicate \_\_pred)` [inherited]`

Invalidates all iterators `x` that reference this sequence, are not singular, and for which `__pred(x)` returns `true`. `__pred` will be invoked with the normal iterators nested in the safe ones.

### 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\< \_SafeSequence \>::\_M\_transfer\_from\_if (\_Safe\_sequence\< \_SafeSequence \> & \_\_from, \_Predicate \_\_pred)` [inherited]`

Transfers all iterators `x` that reference `from` sequence, are not singular, and for which `__pred(x)` returns `true`. `__pred` will be invoked with the normal iterators nested in the safe ones.

## 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\_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()**.

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