---
name: "std::__atomic_base"
section: "3cxx"
platform: "linux"
package: "libstdc++-11-doc"
version: "11.3.0-12"
release: "Debian 12 (Bookworm)"
platforms: ["linux"]
url: "https://new.carta.tech/std::__atomic_base"
---

# std::\_\_atomic\_base(3cxx)

Base class for atomic integrals.

## NAME

std::\_\_atomic\_base\< \_ITp \> - Base class for atomic integrals.

## SYNOPSIS

`#include <atomic_base.h>`

### Public Types

using **difference\_type** = value\_type\
 using **value\_type** = \_ITp\

### Public Member Functions

constexpr **\_\_atomic\_base** (\_\_int\_type \_\_i) noexcept\
 **\_\_atomic\_base** (const **\_\_atomic\_base** &)=delete\
 bool **compare\_exchange\_strong** (\_\_int\_type &\_\_i1, \_\_int\_type \_\_i2, **memory\_order** \_\_m1, **memory\_order** \_\_m2) noexcept\
 bool **compare\_exchange\_strong** (\_\_int\_type &\_\_i1, \_\_int\_type \_\_i2, **memory\_order** \_\_m1, **memory\_order** \_\_m2) volatile noexcept\
 bool **compare\_exchange\_strong** (\_\_int\_type &\_\_i1, \_\_int\_type \_\_i2, **memory\_order** \_\_m=memory\_order\_seq\_cst) noexcept\
 bool **compare\_exchange\_strong** (\_\_int\_type &\_\_i1, \_\_int\_type \_\_i2, **memory\_order** \_\_m=memory\_order\_seq\_cst) volatile noexcept\
 bool **compare\_exchange\_weak** (\_\_int\_type &\_\_i1, \_\_int\_type \_\_i2, **memory\_order** \_\_m1, **memory\_order** \_\_m2) noexcept\
 bool **compare\_exchange\_weak** (\_\_int\_type &\_\_i1, \_\_int\_type \_\_i2, **memory\_order** \_\_m1, **memory\_order** \_\_m2) volatile noexcept\
 bool **compare\_exchange\_weak** (\_\_int\_type &\_\_i1, \_\_int\_type \_\_i2, **memory\_order** \_\_m=memory\_order\_seq\_cst) noexcept\
 bool **compare\_exchange\_weak** (\_\_int\_type &\_\_i1, \_\_int\_type \_\_i2, **memory\_order** \_\_m=memory\_order\_seq\_cst) volatile noexcept\
 \_\_int\_type **exchange** (\_\_int\_type \_\_i, **memory\_order** \_\_m=memory\_order\_seq\_cst) noexcept\
 \_\_int\_type **exchange** (\_\_int\_type \_\_i, **memory\_order** \_\_m=memory\_order\_seq\_cst) volatile noexcept\
 \_\_int\_type **fetch\_add** (\_\_int\_type \_\_i, **memory\_order** \_\_m=memory\_order\_seq\_cst) noexcept\
 \_\_int\_type **fetch\_add** (\_\_int\_type \_\_i, **memory\_order** \_\_m=memory\_order\_seq\_cst) volatile noexcept\
 \_\_int\_type **fetch\_and** (\_\_int\_type \_\_i, **memory\_order** \_\_m=memory\_order\_seq\_cst) noexcept\
 \_\_int\_type **fetch\_and** (\_\_int\_type \_\_i, **memory\_order** \_\_m=memory\_order\_seq\_cst) volatile noexcept\
 \_\_int\_type **fetch\_or** (\_\_int\_type \_\_i, **memory\_order** \_\_m=memory\_order\_seq\_cst) noexcept\
 \_\_int\_type **fetch\_or** (\_\_int\_type \_\_i, **memory\_order** \_\_m=memory\_order\_seq\_cst) volatile noexcept\
 \_\_int\_type **fetch\_sub** (\_\_int\_type \_\_i, **memory\_order** \_\_m=memory\_order\_seq\_cst) noexcept\
 \_\_int\_type **fetch\_sub** (\_\_int\_type \_\_i, **memory\_order** \_\_m=memory\_order\_seq\_cst) volatile noexcept\
 \_\_int\_type **fetch\_xor** (\_\_int\_type \_\_i, **memory\_order** \_\_m=memory\_order\_seq\_cst) noexcept\
 \_\_int\_type **fetch\_xor** (\_\_int\_type \_\_i, **memory\_order** \_\_m=memory\_order\_seq\_cst) volatile noexcept\
 bool **is\_lock\_free** () const noexcept\
 bool **is\_lock\_free** () const volatile noexcept\
 \_\_int\_type **load** (**memory\_order** \_\_m=memory\_order\_seq\_cst) const noexcept\
 \_\_int\_type **load** (**memory\_order** \_\_m=memory\_order\_seq\_cst) const volatile noexcept\
 **operator \_\_int\_type** () const noexcept\
 **operator \_\_int\_type** () const volatile noexcept\
 \_\_int\_type **operator&=** (\_\_int\_type \_\_i) noexcept\
 \_\_int\_type **operator&=** (\_\_int\_type \_\_i) volatile noexcept\
 \_\_int\_type **operator++** () noexcept\
 \_\_int\_type **operator++** () volatile noexcept\
 \_\_int\_type **operator++** (int) noexcept\
 \_\_int\_type **operator++** (int) volatile noexcept\
 \_\_int\_type **operator+=** (\_\_int\_type \_\_i) noexcept\
 \_\_int\_type **operator+=** (\_\_int\_type \_\_i) volatile noexcept\
 \_\_int\_type **operator--** () noexcept\
 \_\_int\_type **operator--** () volatile noexcept\
 \_\_int\_type **operator--** (int) noexcept\
 \_\_int\_type **operator--** (int) volatile noexcept\
 \_\_int\_type **operator-=** (\_\_int\_type \_\_i) noexcept\
 \_\_int\_type **operator-=** (\_\_int\_type \_\_i) volatile noexcept\
 \_\_int\_type **operator=** (\_\_int\_type \_\_i) noexcept\
 \_\_int\_type **operator=** (\_\_int\_type \_\_i) volatile noexcept\
 **\_\_atomic\_base** & **operator=** (const **\_\_atomic\_base** &) volatile=delete\
 **\_\_atomic\_base** & **operator=** (const **\_\_atomic\_base** &)=delete\
 \_\_int\_type **operator^=** (\_\_int\_type \_\_i) noexcept\
 \_\_int\_type **operator^=** (\_\_int\_type \_\_i) volatile noexcept\
 \_\_int\_type **operator\|=** (\_\_int\_type \_\_i) noexcept\
 \_\_int\_type **operator\|=** (\_\_int\_type \_\_i) volatile noexcept\
 void **store** (\_\_int\_type \_\_i, **memory\_order** \_\_m=memory\_order\_seq\_cst) noexcept\
 void **store** (\_\_int\_type \_\_i, **memory\_order** \_\_m=memory\_order\_seq\_cst) volatile noexcept\

## Detailed Description

### template\<typename \_ITp\>

struct std::\_\_atomic\_base\< \_ITp \>"Base class for atomic integrals.

Definition at line **324** of file **atomic\_base.h**.

## Member Typedef Documentation

### template\<typename \_ITp \> using std::\_\_atomic\_base\< \_ITp \>::difference\_type = value\_type

Definition at line **327** of file **atomic\_base.h**.

### template\<typename \_ITp \> using std::\_\_atomic\_base\< \_ITp \>::value\_type = \_ITp

Definition at line **326** of file **atomic\_base.h**.

## Constructor & Destructor Documentation

### template\<typename \_ITp \> constexpr std::\_\_atomic\_base\< \_ITp \>::\_\_atomic\_base (\_\_int\_type \_\_i)` [inline]`, ` [constexpr]`, ` [noexcept]`

Definition at line **345** of file **atomic\_base.h**.

## Member Function Documentation

### template\<typename \_ITp \> bool std::\_\_atomic\_base\< \_ITp \>::compare\_exchange\_strong (\_\_int\_type & \_\_i1, \_\_int\_type \_\_i2, memory\_order \_\_m1, memory\_order \_\_m2)` [inline]`, ` [noexcept]`

Definition at line **555** of file **atomic\_base.h**.

### template\<typename \_ITp \> bool std::\_\_atomic\_base\< \_ITp \>::compare\_exchange\_strong (\_\_int\_type & \_\_i1, \_\_int\_type \_\_i2, memory\_order \_\_m1, memory\_order \_\_m2) volatile` [inline]`, ` [noexcept]`

Definition at line **565** of file **atomic\_base.h**.

### template\<typename \_ITp \> bool std::\_\_atomic\_base\< \_ITp \>::compare\_exchange\_strong (\_\_int\_type & \_\_i1, \_\_int\_type \_\_i2, memory\_order \_\_m = `memory_order_seq_cst`)` [inline]`, ` [noexcept]`

Definition at line **576** of file **atomic\_base.h**.

### template\<typename \_ITp \> bool std::\_\_atomic\_base\< \_ITp \>::compare\_exchange\_strong (\_\_int\_type & \_\_i1, \_\_int\_type \_\_i2, memory\_order \_\_m = `memory_order_seq_cst`) volatile` [inline]`, ` [noexcept]`

Definition at line **584** of file **atomic\_base.h**.

### template\<typename \_ITp \> bool std::\_\_atomic\_base\< \_ITp \>::compare\_exchange\_weak (\_\_int\_type & \_\_i1, \_\_int\_type \_\_i2, memory\_order \_\_m1, memory\_order \_\_m2)` [inline]`, ` [noexcept]`

Definition at line **518** of file **atomic\_base.h**.

### template\<typename \_ITp \> bool std::\_\_atomic\_base\< \_ITp \>::compare\_exchange\_weak (\_\_int\_type & \_\_i1, \_\_int\_type \_\_i2, memory\_order \_\_m1, memory\_order \_\_m2) volatile` [inline]`, ` [noexcept]`

Definition at line **528** of file **atomic\_base.h**.

### template\<typename \_ITp \> bool std::\_\_atomic\_base\< \_ITp \>::compare\_exchange\_weak (\_\_int\_type & \_\_i1, \_\_int\_type \_\_i2, memory\_order \_\_m = `memory_order_seq_cst`)` [inline]`, ` [noexcept]`

Definition at line **539** of file **atomic\_base.h**.

### template\<typename \_ITp \> bool std::\_\_atomic\_base\< \_ITp \>::compare\_exchange\_weak (\_\_int\_type & \_\_i1, \_\_int\_type \_\_i2, memory\_order \_\_m = `memory_order_seq_cst`) volatile` [inline]`, ` [noexcept]`

Definition at line **547** of file **atomic\_base.h**.

### template\<typename \_ITp \> \_\_int\_type std::\_\_atomic\_base\< \_ITp \>::exchange (\_\_int\_type \_\_i, memory\_order \_\_m = `memory_order_seq_cst`)` [inline]`, ` [noexcept]`

Definition at line **503** of file **atomic\_base.h**.

### template\<typename \_ITp \> \_\_int\_type std::\_\_atomic\_base\< \_ITp \>::exchange (\_\_int\_type \_\_i, memory\_order \_\_m = `memory_order_seq_cst`) volatile` [inline]`, ` [noexcept]`

Definition at line **511** of file **atomic\_base.h**.

### template\<typename \_ITp \> \_\_int\_type std::\_\_atomic\_base\< \_ITp \>::fetch\_add (\_\_int\_type \_\_i, memory\_order \_\_m = `memory_order_seq_cst`)` [inline]`, ` [noexcept]`

Definition at line **616** of file **atomic\_base.h**.

### template\<typename \_ITp \> \_\_int\_type std::\_\_atomic\_base\< \_ITp \>::fetch\_add (\_\_int\_type \_\_i, memory\_order \_\_m = `memory_order_seq_cst`) volatile` [inline]`, ` [noexcept]`

Definition at line **621** of file **atomic\_base.h**.

### template\<typename \_ITp \> \_\_int\_type std::\_\_atomic\_base\< \_ITp \>::fetch\_and (\_\_int\_type \_\_i, memory\_order \_\_m = `memory_order_seq_cst`)` [inline]`, ` [noexcept]`

Definition at line **636** of file **atomic\_base.h**.

### template\<typename \_ITp \> \_\_int\_type std::\_\_atomic\_base\< \_ITp \>::fetch\_and (\_\_int\_type \_\_i, memory\_order \_\_m = `memory_order_seq_cst`) volatile` [inline]`, ` [noexcept]`

Definition at line **641** of file **atomic\_base.h**.

### template\<typename \_ITp \> \_\_int\_type std::\_\_atomic\_base\< \_ITp \>::fetch\_or (\_\_int\_type \_\_i, memory\_order \_\_m = `memory_order_seq_cst`)` [inline]`, ` [noexcept]`

Definition at line **646** of file **atomic\_base.h**.

### template\<typename \_ITp \> \_\_int\_type std::\_\_atomic\_base\< \_ITp \>::fetch\_or (\_\_int\_type \_\_i, memory\_order \_\_m = `memory_order_seq_cst`) volatile` [inline]`, ` [noexcept]`

Definition at line **651** of file **atomic\_base.h**.

### template\<typename \_ITp \> \_\_int\_type std::\_\_atomic\_base\< \_ITp \>::fetch\_sub (\_\_int\_type \_\_i, memory\_order \_\_m = `memory_order_seq_cst`)` [inline]`, ` [noexcept]`

Definition at line **626** of file **atomic\_base.h**.

### template\<typename \_ITp \> \_\_int\_type std::\_\_atomic\_base\< \_ITp \>::fetch\_sub (\_\_int\_type \_\_i, memory\_order \_\_m = `memory_order_seq_cst`) volatile` [inline]`, ` [noexcept]`

Definition at line **631** of file **atomic\_base.h**.

### template\<typename \_ITp \> \_\_int\_type std::\_\_atomic\_base\< \_ITp \>::fetch\_xor (\_\_int\_type \_\_i, memory\_order \_\_m = `memory_order_seq_cst`)` [inline]`, ` [noexcept]`

Definition at line **656** of file **atomic\_base.h**.

### template\<typename \_ITp \> \_\_int\_type std::\_\_atomic\_base\< \_ITp \>::fetch\_xor (\_\_int\_type \_\_i, memory\_order \_\_m = `memory_order_seq_cst`) volatile` [inline]`, ` [noexcept]`

Definition at line **661** of file **atomic\_base.h**.

### template\<typename \_ITp \> bool std::\_\_atomic\_base\< \_ITp \>::is\_lock\_free () const` [inline]`, ` [noexcept]`

Definition at line **440** of file **atomic\_base.h**.

### template\<typename \_ITp \> bool std::\_\_atomic\_base\< \_ITp \>::is\_lock\_free () const volatile` [inline]`, ` [noexcept]`

Definition at line **448** of file **atomic\_base.h**.

### template\<typename \_ITp \> \_\_int\_type std::\_\_atomic\_base\< \_ITp \>::load (memory\_order \_\_m = `memory_order_seq_cst`) const` [inline]`, ` [noexcept]`

Definition at line **481** of file **atomic\_base.h**.

### template\<typename \_ITp \> \_\_int\_type std::\_\_atomic\_base\< \_ITp \>::load (memory\_order \_\_m = `memory_order_seq_cst`) const volatile` [inline]`, ` [noexcept]`

Definition at line **492** of file **atomic\_base.h**.

### template\<typename \_ITp \> std::\_\_atomic\_base\< \_ITp \>::operator \_\_int\_type () const` [inline]`, ` [noexcept]`

Definition at line **347** of file **atomic\_base.h**.

### template\<typename \_ITp \> std::\_\_atomic\_base\< \_ITp \>::operator \_\_int\_type () const volatile` [inline]`, ` [noexcept]`

Definition at line **350** of file **atomic\_base.h**.

### template\<typename \_ITp \> \_\_int\_type std::\_\_atomic\_base\< \_ITp \>::operator&= (\_\_int\_type \_\_i)` [inline]`, ` [noexcept]`

Definition at line **416** of file **atomic\_base.h**.

### template\<typename \_ITp \> \_\_int\_type std::\_\_atomic\_base\< \_ITp \>::operator&= (\_\_int\_type \_\_i) volatile` [inline]`, ` [noexcept]`

Definition at line **420** of file **atomic\_base.h**.

### template\<typename \_ITp \> \_\_int\_type std::\_\_atomic\_base\< \_ITp \>::operator++ ()` [inline]`, ` [noexcept]`

Definition at line **384** of file **atomic\_base.h**.

### template\<typename \_ITp \> \_\_int\_type std::\_\_atomic\_base\< \_ITp \>::operator++ () volatile` [inline]`, ` [noexcept]`

Definition at line **388** of file **atomic\_base.h**.

### template\<typename \_ITp \> \_\_int\_type std::\_\_atomic\_base\< \_ITp \>::operator++ (int)` [inline]`, ` [noexcept]`

Definition at line **368** of file **atomic\_base.h**.

### template\<typename \_ITp \> \_\_int\_type std::\_\_atomic\_base\< \_ITp \>::operator++ (int) volatile` [inline]`, ` [noexcept]`

Definition at line **372** of file **atomic\_base.h**.

### template\<typename \_ITp \> \_\_int\_type std::\_\_atomic\_base\< \_ITp \>::operator+= (\_\_int\_type \_\_i)` [inline]`, ` [noexcept]`

Definition at line **400** of file **atomic\_base.h**.

### template\<typename \_ITp \> \_\_int\_type std::\_\_atomic\_base\< \_ITp \>::operator+= (\_\_int\_type \_\_i) volatile` [inline]`, ` [noexcept]`

Definition at line **404** of file **atomic\_base.h**.

### template\<typename \_ITp \> \_\_int\_type std::\_\_atomic\_base\< \_ITp \>::operator-- ()` [inline]`, ` [noexcept]`

Definition at line **392** of file **atomic\_base.h**.

### template\<typename \_ITp \> \_\_int\_type std::\_\_atomic\_base\< \_ITp \>::operator-- () volatile` [inline]`, ` [noexcept]`

Definition at line **396** of file **atomic\_base.h**.

### template\<typename \_ITp \> \_\_int\_type std::\_\_atomic\_base\< \_ITp \>::operator-- (int)` [inline]`, ` [noexcept]`

Definition at line **376** of file **atomic\_base.h**.

### template\<typename \_ITp \> \_\_int\_type std::\_\_atomic\_base\< \_ITp \>::operator-- (int) volatile` [inline]`, ` [noexcept]`

Definition at line **380** of file **atomic\_base.h**.

### template\<typename \_ITp \> \_\_int\_type std::\_\_atomic\_base\< \_ITp \>::operator-= (\_\_int\_type \_\_i)` [inline]`, ` [noexcept]`

Definition at line **408** of file **atomic\_base.h**.

### template\<typename \_ITp \> \_\_int\_type std::\_\_atomic\_base\< \_ITp \>::operator-= (\_\_int\_type \_\_i) volatile` [inline]`, ` [noexcept]`

Definition at line **412** of file **atomic\_base.h**.

### template\<typename \_ITp \> \_\_int\_type std::\_\_atomic\_base\< \_ITp \>::operator= (\_\_int\_type \_\_i)` [inline]`, ` [noexcept]`

Definition at line **354** of file **atomic\_base.h**.

### template\<typename \_ITp \> \_\_int\_type std::\_\_atomic\_base\< \_ITp \>::operator= (\_\_int\_type \_\_i) volatile` [inline]`, ` [noexcept]`

Definition at line **361** of file **atomic\_base.h**.

### template\<typename \_ITp \> \_\_int\_type std::\_\_atomic\_base\< \_ITp \>::operator^= (\_\_int\_type \_\_i)` [inline]`, ` [noexcept]`

Definition at line **432** of file **atomic\_base.h**.

### template\<typename \_ITp \> \_\_int\_type std::\_\_atomic\_base\< \_ITp \>::operator^= (\_\_int\_type \_\_i) volatile` [inline]`, ` [noexcept]`

Definition at line **436** of file **atomic\_base.h**.

### template\<typename \_ITp \> \_\_int\_type std::\_\_atomic\_base\< \_ITp \>::operator\|= (\_\_int\_type \_\_i)` [inline]`, ` [noexcept]`

Definition at line **424** of file **atomic\_base.h**.

### template\<typename \_ITp \> \_\_int\_type std::\_\_atomic\_base\< \_ITp \>::operator\|= (\_\_int\_type \_\_i) volatile` [inline]`, ` [noexcept]`

Definition at line **428** of file **atomic\_base.h**.

### template\<typename \_ITp \> void std::\_\_atomic\_base\< \_ITp \>::store (\_\_int\_type \_\_i, memory\_order \_\_m = `memory_order_seq_cst`)` [inline]`, ` [noexcept]`

Definition at line **456** of file **atomic\_base.h**.

### template\<typename \_ITp \> void std::\_\_atomic\_base\< \_ITp \>::store (\_\_int\_type \_\_i, memory\_order \_\_m = `memory_order_seq_cst`) volatile` [inline]`, ` [noexcept]`

Definition at line **468** of file **atomic\_base.h**.

## Author

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