std::atomic< _Tp > Struct Template Reference
Atomics

`#include <atomic>`

## Public Types

using | value_type

## Public Member Functions

constexpr | atomic (_Tp __i) noexcept
| atomic (const atomic &)=delete
bool | compare_exchange_strong (_Tp &__e, _Tp __i, memory_order __m=memory_order_seq_cst) noexcept
bool | compare_exchange_strong (_Tp &__e, _Tp __i, memory_order __m=memory_order_seq_cst) volatile noexcept
bool | compare_exchange_strong (_Tp &__e, _Tp __i, memory_order __s, memory_order __f) noexcept
bool | compare_exchange_strong (_Tp &__e, _Tp __i, memory_order __s, memory_order __f) volatile noexcept
bool | compare_exchange_weak (_Tp &__e, _Tp __i, memory_order __m=memory_order_seq_cst) noexcept
bool | compare_exchange_weak (_Tp &__e, _Tp __i, memory_order __m=memory_order_seq_cst) volatile noexcept
bool | compare_exchange_weak (_Tp &__e, _Tp __i, memory_order __s, memory_order __f) noexcept
bool | compare_exchange_weak (_Tp &__e, _Tp __i, memory_order __s, memory_order __f) volatile noexcept
_Tp | exchange (_Tp __i, memory_order __m=memory_order_seq_cst) noexcept
_Tp | exchange (_Tp __i, memory_order __m=memory_order_seq_cst) volatile noexcept
bool | is_lock_free () const noexcept
bool | is_lock_free () const volatile noexcept
_Tp | load (memory_order __m=memory_order_seq_cst) const noexcept
_Tp | load (memory_order __m=memory_order_seq_cst) const volatile noexcept
| operator _Tp () const noexcept
| operator _Tp () const volatile noexcept
_Tp | operator= (_Tp __i) noexcept
_Tp | operator= (_Tp __i) volatile noexcept
atomic & | operator= (const atomic &) volatile =delete
atomic & | operator= (const atomic &)=delete
void | store (_Tp __i, memory_order __m=memory_order_seq_cst) noexcept
void | store (_Tp __i, memory_order __m=memory_order_seq_cst) volatile noexcept

## Detailed Description

template<typename _Tp>
struct std::atomic< _Tp >

Generic atomic type, primary class template.

Template Parameters

  _Tp | Type to be made atomic, must be trivially copyable.

Definition at line 200 of file atomic.

## Member Typedef Documentation

## value_type

template<typename _Tp>

using std::atomic< _Tp >::value_type

Definition at line 202 of file atomic.

## Constructor & Destructor Documentation

## atomic()

template<typename _Tp>

std::atomic< _Tp >::atomic | ( | _Tp | __i | ) |

inline constexpr noexcept

Definition at line 252 of file atomic.

## Member Function Documentation

## compare_exchange_strong() [1/4]

template<typename _Tp>

bool std::atomic< _Tp >::compare_exchange_strong | ( | _Tp & | __e,
|  | _Tp | __i,
|  | memory_order | __m = memory_order_seq_cst )

inline noexcept

Definition at line 399 of file atomic.

## compare_exchange_strong() [2/4]

template<typename _Tp>

bool std::atomic< _Tp >::compare_exchange_strong | ( | _Tp & | __e,
|  | _Tp | __i,
|  | memory_order | __m = memory_order_seq_cst ) volatile

inline noexcept

Definition at line 405 of file atomic.

## compare_exchange_strong() [3/4]

template<typename _Tp>

bool std::atomic< _Tp >::compare_exchange_strong | ( | _Tp & | __e,
|  | _Tp | __i,
|  | memory_order | __s,
|  | memory_order | __f )

inline noexcept

Definition at line 383 of file atomic.

## compare_exchange_strong() [4/4]

template<typename _Tp>

bool std::atomic< _Tp >::compare_exchange_strong | ( | _Tp & | __e,
|  | _Tp | __i,
|  | memory_order | __s,
|  | memory_order | __f ) volatile

inline noexcept

Definition at line 391 of file atomic.

## compare_exchange_weak() [1/4]

template<typename _Tp>

bool std::atomic< _Tp >::compare_exchange_weak | ( | _Tp & | __e,
|  | _Tp | __i,
|  | memory_order | __m = memory_order_seq_cst )

inline noexcept

Definition at line 371 of file atomic.

## compare_exchange_weak() [2/4]

template<typename _Tp>

bool std::atomic< _Tp >::compare_exchange_weak | ( | _Tp & | __e,
|  | _Tp | __i,
|  | memory_order | __m = memory_order_seq_cst ) volatile

inline noexcept

Definition at line 377 of file atomic.

## compare_exchange_weak() [3/4]

template<typename _Tp>

bool std::atomic< _Tp >::compare_exchange_weak | ( | _Tp & | __e,
|  | _Tp | __i,
|  | memory_order | __s,
|  | memory_order | __f )

inline noexcept

Definition at line 355 of file atomic.

## compare_exchange_weak() [4/4]

template<typename _Tp>

bool std::atomic< _Tp >::compare_exchange_weak | ( | _Tp & | __e,
|  | _Tp | __i,
|  | memory_order | __s,
|  | memory_order | __f ) volatile

inline noexcept

Definition at line 363 of file atomic.

## exchange() [1/2]

template<typename _Tp>

_Tp std::atomic< _Tp >::exchange | ( | _Tp | __i,
|  | memory_order | __m = memory_order_seq_cst )

inline noexcept

Definition at line 332 of file atomic.

## exchange() [2/2]

template<typename _Tp>

_Tp std::atomic< _Tp >::exchange | ( | _Tp | __i,
|  | memory_order | __m = memory_order_seq_cst ) volatile

inline noexcept

Definition at line 343 of file atomic.

## is_lock_free() [1/2]

template<typename _Tp>

bool std::atomic< _Tp >::is_lock_free | ( |  | ) | const

inline noexcept

Definition at line 277 of file atomic.

## is_lock_free() [2/2]

template<typename _Tp>

bool std::atomic< _Tp >::is_lock_free | ( |  | ) | const volatile

inline noexcept

Definition at line 285 of file atomic.

## load() [1/2]

template<typename _Tp>

_Tp std::atomic< _Tp >::load | ( | memory_order | __m = memory_order_seq_cst | ) | const

inline noexcept

Definition at line 314 of file atomic.

## load() [2/2]

template<typename _Tp>

_Tp std::atomic< _Tp >::load | ( | memory_order | __m = memory_order_seq_cst | ) | const volatile

inline noexcept

Definition at line 323 of file atomic.

## operator _Tp() [1/2]

template<typename _Tp>

std::atomic< _Tp >::operator _Tp | ( |  | ) | const

inline noexcept

Definition at line 262 of file atomic.

## operator _Tp() [2/2]

template<typename _Tp>

std::atomic< _Tp >::operator _Tp | ( |  | ) | const volatile

inline noexcept

Definition at line 265 of file atomic.

## operator=() [1/2]

template<typename _Tp>

_Tp std::atomic< _Tp >::operator= | ( | _Tp | __i | ) |

inline noexcept

Definition at line 269 of file atomic.

## operator=() [2/2]

template<typename _Tp>

_Tp std::atomic< _Tp >::operator= | ( | _Tp | __i | ) | volatile

inline noexcept

Definition at line 273 of file atomic.

## store() [1/2]

template<typename _Tp>

void std::atomic< _Tp >::store | ( | _Tp | __i,
|  | memory_order | __m = memory_order_seq_cst )

inline noexcept

Definition at line 298 of file atomic.

## store() [2/2]

template<typename _Tp>

void std::atomic< _Tp >::store | ( | _Tp | __i,
|  | memory_order | __m = memory_order_seq_cst ) volatile

inline noexcept

Definition at line 306 of file atomic.

The documentation for this struct was generated from the following file:

- atomic