STD::ATOMIC(3cxx)
π
std::atomic< _Tp >(3cxx) β atomic-teen dream π
okay so bestie, welcome to the std::atomic< _Tp > page from libstdc++, manual section (3cxx). itβs literally the generic atomic type + primary class template, and itβs giving main character energy fr fr. π«Άβ¨
πΈ NAME πΈ
std::atomic< _Tp > β the generic atomic type, primary class template. periodt. π
β¨ SYNOPSIS β¨
start with this include, bestie:
#include <atomic>
π Public Types π
using value_type = _Tpβ the public type alias, exactly as written. no cap. π
π Public Member Functions π
constexpr atomic (_Tp __i) noexceptβ constructor taking_Tp __i, and itβsconstexpr+noexcept. cute. β¨atomic (const atomic &)=deleteβ this constructor overload is=delete, so itβs a hard no. π«bool compare_exchange_strong (_Tp &__e, _Tp __i, memory_order __m=memory_order_seq_cst) noexceptβ the strong compare-exchange overload withmemory_order __m=memory_order_seq_cst,noexcept. πbool compare_exchange_strong (_Tp &__e, _Tp __i, memory_order __m=memory_order_seq_cst) volatile noexceptβ same strong overload, butvolatile, same defaultmemory_order __m=memory_order_seq_cst,noexcept. πbool compare_exchange_strong (_Tp &__e, _Tp __i, memory_order __s, memory_order __f) noexceptβ strong overload withmemory_order __s, memory_order __f,noexcept. βbool compare_exchange_strong (_Tp &__e, _Tp __i, memory_order __s, memory_order __f) volatile noexceptβ same strong overload butvolatile, withmemory_order __s, memory_order __f,noexcept. π«bool compare_exchange_weak (_Tp &__e, _Tp __i, memory_order __m=memory_order_seq_cst) noexceptβ the weak compare-exchange overload withmemory_order __m=memory_order_seq_cst,noexcept. πbool compare_exchange_weak (_Tp &__e, _Tp __i, memory_order __m=memory_order_seq_cst) volatile noexceptβ same weak overload, butvolatile, same defaultmemory_order __m=memory_order_seq_cst,noexcept. π§bool compare_exchange_weak (_Tp &__e, _Tp __i, memory_order __s, memory_order __f) noexceptβ weak overload withmemory_order __s, memory_order __f,noexcept. πΈbool compare_exchange_weak (_Tp &__e, _Tp __i, memory_order __s, memory_order __f) volatile noexceptβ same weak overload butvolatile, withmemory_order __s, memory_order __f,noexcept. π¦_Tp exchange (_Tp __i, memory_order __m=memory_order_seq_cst) noexceptβexchangewith_Tp __i, defaultmemory_order __m=memory_order_seq_cst,noexcept. π₯_Tp exchange (_Tp __i, memory_order __m=memory_order_seq_cst) volatile noexceptβ sameexchangebutvolatile, defaultmemory_order __m=memory_order_seq_cst,noexcept. πbool is_lock_free () const noexceptβis_lock_free(),const,noexcept. πbool is_lock_free () const volatile noexceptβ sameis_lock_free()butconst volatile,noexcept. π_Tp load (memory_order __m=memory_order_seq_cst) const noexceptβloadwith defaultmemory_order __m=memory_order_seq_cst,const,noexcept. β_Tp load (memory_order __m=memory_order_seq_cst) const volatile noexceptβ sameloadbutconst volatile, defaultmemory_order __m=memory_order_seq_cst,noexcept. π«operator _Tp () const noexceptβ conversion operator to_Tp,const,noexcept. πoperator _Tp () const volatile noexceptβ same conversion operator butconst volatile,noexcept. π_Tp operator= (_Tp __i) noexceptβ assignment from_Tp __i,noexcept. π_Tp operator= (_Tp __i) volatile noexceptβ same assignment from_Tp __ibutvolatile,noexcept. β¨atomic & operator= (const atomic &) volatile=deleteβ assignment fromconst atomic &isvolatile=delete. π«atomic & operator= (const atomic &)=deleteβ assignment fromconst atomic &is=delete. π«void store (_Tp __i, memory_order __m=memory_order_seq_cst) noexceptβstorewith_Tp __i, defaultmemory_order __m=memory_order_seq_cst,noexcept. πΈvoid store (_Tp __i, memory_order __m=memory_order_seq_cst) volatile noexceptβ samestorebutvolatile, defaultmemory_order __m=memory_order_seq_cst,noexcept. π¦
π¦ Detailed Description π¦
hereβs the raw template snippet, exactly as the page gives it:
template<typename _Tp>
struct std::atomic< _Tp >"Generic atomic type, primary class template.
in human terms: itβs the generic atomic type, and itβs the primary class template. slay. π
π Template Parameters π
_Tpβ type to be made atomic, must be trivially copyable. thatβs the rule, bestie. π«Ά
π Author π
Generated automatically by Doxygen for libstdc++ from the source code. so yeah, Doxygen auto-generated this for libstdc++ straight from the source β robot author moment. π€β¨
okay thatβs the whole page, bestie π source/version: libstdc++; manual page: std::atomic< _Tp >(3cxx); date in the footer: not printed, so no cute date to give you. bye, slay, and may your atomics be iconic ππ¦
π¦ where this page comes from
- ubuntu noble: libstdc++-14-doc 14-20240412-0ubuntu1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms