---
name: "__gnu_debug::_Safe_node_sequence"
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_node_sequence/3cxx"
---

# \_\_gnu\_debug::\_Safe\_node\_sequence(3cxx)

Like \_Safe\_sequence but with a special \_M\_invalidate\_all implementation not invalidating past-the-end iterators. Used by node based sequence.

## NAME

\_\_gnu\_debug::\_Safe\_node\_sequence\< \_Sequence \> - Like \_Safe\_sequence but with a special \_M\_invalidate\_all implementation not invalidating past-the-end iterators. Used by node based sequence.

## SYNOPSIS

`#include <safe_sequence.h>`

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

### Public Member Functions

template\<typename \_Predicate \> void **\_M\_invalidate\_if** (\_Predicate \_\_pred)\
 template\<typename \_Predicate \> 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** &\_\_x) noexcept\

## Detailed Description

### template\<typename \_Sequence\>

class \_\_gnu\_debug::\_Safe\_node\_sequence\< \_Sequence \>"Like \_Safe\_sequence but with a special \_M\_invalidate\_all implementation not invalidating past-the-end iterators. Used by node based sequence.

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

### template\<typename \_Sequence \> template\<typename \_Predicate \> void \_\_gnu\_debug::\_Safe\_sequence\< \_Sequence \>::\_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\_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.

### template\<typename \_Sequence \> template\<typename \_Predicate \> void \_\_gnu\_debug::\_Safe\_sequence\< \_Sequence \>::\_M\_transfer\_from\_if (\_Safe\_sequence\< \_Sequence \> & \_\_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.

References **std::\_\_addressof()**, **\_\_gnu\_debug::\_Safe\_sequence\_base::\_M\_const\_iterators**, **\_\_gnu\_debug::\_Safe\_iterator\_base::\_M\_detach\_single()**, **\_\_gnu\_debug::\_Safe\_sequence\_base::\_M\_get\_mutex()**, **\_\_gnu\_debug::\_Safe\_sequence\_base::\_M\_iterators**, **\_\_gnu\_debug::\_Safe\_iterator\_base::\_M\_next**, **\_\_gnu\_debug::\_Safe\_iterator\_base::\_M\_prior**, **\_\_gnu\_debug::\_Safe\_iterator\_base::\_M\_sequence**, and **\_\_gnu\_debug::\_Safe\_iterator\_base::\_M\_version**.

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