---
name: "__gnu_debug::_Safe_forward_list"
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_debug::_Safe_forward_list"
---

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

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 \>**.

Inherited by **\_\_gnu\_debug::\_Safe\_container\< forward\_list, \_Alloc, \_\_gnu\_debug::\_Safe\_forward\_list \>**.

### Public Member Functions

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

### 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** () const\
 void **\_M\_detach\_singular** () const\
 \_\_gnu\_cxx::\_\_mutex & **\_M\_get\_mutex** () const noexcept\
 void **\_M\_invalidate\_all** () const\
 void **\_M\_revalidate\_singular** () const\
 void **\_M\_swap** (const **\_Safe\_forward\_list** &) const noexcept\
 void **\_M\_swap** (const **\_Safe\_sequence\_base** &\_\_x) const 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 () const \[protected\], \[inherited\]

Detach all iterators, leaving them singular.

### void \_\_gnu\_debug::\_Safe\_sequence\_base::\_M\_detach\_singular () const \[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 () const \[protected\], \[noexcept\], \[inherited\]

For use in \_Safe\_sequence.

### void \_\_gnu\_debug::\_Safe\_sequence\< \_SafeSequence \>::\_M\_invalidate\_if (\_Predicate \_\_pred) const \[inline\], \[constexpr\], \[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 () const \[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 (const \_Safe\_sequence\_base & \_\_x) const \[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\_sequence\< \_SafeSequence \>::\_M\_transfer\_from\_if (const \_Safe\_sequence\< \_SafeSequence \> & \_\_from, \_Predicate \_\_pred) const \[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.

References **\_M\_iterators**.

## Member Data Documentation

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

The list of constant iterators that reference this container.

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

The list of mutable iterators that reference this container.

Referenced by **\_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.

## Author

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