STD::__ATOMIC_BASE(3cxx)
β¨ NAME β¨
std::__atomic_base< _ITp > β bestie, this is the base class for atomic integrals. That's it, that's the whole vibe. It lives in the libstdc++ manual, section 3cxx, and it's the lowkey iconic foundation everything atomic-integer-shaped gets built on top of. π
π¦ SYNOPSIS π¦
π Public Types π
using difference_type = value_typeβ literally just an alias pointing atvalue_type, she's not doing anything extra, she's just here. π«Άusing value_type = _ITpβ the actual type you templated in, wearing a little name tag. πΈ
π Public Member Functions π
okay so here's the whole roster, no skips, no shortcuts, every single overload accounted for. π§
constexpr __atomic_base (__int_type __i) noexceptβ the constructor. Takes an__int_type __i, isconstexpr, isnoexcept. She's ready.__atomic_base (const __atomic_base &)=deleteβ copy constructor? deleted. you cannot copy her, no cap. πbool compare_exchange_strong (__int_type &__i1, __int_type __i2, memory_order __m1, memory_order __m2) noexceptβ the strong one, with two explicit memory orders,__m1and__m2. πͺbool compare_exchange_strong (__int_type &__i1, __int_type __i2, memory_order __m1, memory_order __m2) volatile noexceptβ same thing butvolatile, because she has a volatile twin and both of them showed up.bool compare_exchange_strong (__int_type &__i1, __int_type __i2, memory_order __m=memory_order_seq_cst) noexceptβ the two-arg-memory-order version, defaulting tomemory_order_seq_cst. default queen. πbool compare_exchange_strong (__int_type &__i1, __int_type __i2, memory_order __m=memory_order_seq_cst) volatile noexceptβ and hervolatilecounterpart, obviously. β¨bool compare_exchange_weak (__int_type &__i1, __int_type __i2, memory_order __m1, memory_order __m2) noexceptβ the weak one. same shape, two memory orders,__m1and__m2.bool compare_exchange_weak (__int_type &__i1, __int_type __i2, memory_order __m1, memory_order __m2) volatile noexceptβ weak +volatile, they come as a set.bool compare_exchange_weak (__int_type &__i1, __int_type __i2, memory_order __m=memory_order_seq_cst) noexceptβ weak with the defaultedmemory_order_seq_cst.bool compare_exchange_weak (__int_type &__i1, __int_type __i2, memory_order __m=memory_order_seq_cst) volatile noexceptβ and thevolatileone. four strongs, four weaks, we stay symmetrical. π__int_type exchange (__int_type __i, memory_order __m=memory_order_seq_cst) noexceptβ swap it out, takes__i, memory order defaults tomemory_order_seq_cst.__int_type exchange (__int_type __i, memory_order __m=memory_order_seq_cst) volatile noexceptβvolatileedition, same energy. π¦__int_type fetch_add (__int_type __i, memory_order __m=memory_order_seq_cst) noexceptβ fetch and add. π__int_type fetch_add (__int_type __i, memory_order __m=memory_order_seq_cst) volatile noexceptβ fetch and add,volatileflavour.__int_type fetch_and (__int_type __i, memory_order __m=memory_order_seq_cst) noexceptβ fetch and bitwise-AND.__int_type fetch_and (__int_type __i, memory_order __m=memory_order_seq_cst) volatile noexceptβ thevolatileAND.__int_type fetch_or (__int_type __i, memory_order __m=memory_order_seq_cst) noexceptβ fetch and bitwise-OR.__int_type fetch_or (__int_type __i, memory_order __m=memory_order_seq_cst) volatile noexceptβvolatileOR.__int_type fetch_sub (__int_type __i, memory_order __m=memory_order_seq_cst) noexceptβ fetch and subtract.__int_type fetch_sub (__int_type __i, memory_order __m=memory_order_seq_cst) volatile noexceptβ subtract, butvolatile.__int_type fetch_xor (__int_type __i, memory_order __m=memory_order_seq_cst) noexceptβ fetch and bitwise-XOR. the spicy one. π₯__int_type fetch_xor (__int_type __i, memory_order __m=memory_order_seq_cst) volatile noexceptβvolatileXOR, equally spicy.bool is_lock_free () const noexceptβ vibe check: is she lock free? asks so herself. πbool is_lock_free () const volatile noexceptβ same question,const volatilethis time.__int_type load (memory_order __m=memory_order_seq_cst) const noexceptβ read the value out,const, memory order defaults tomemory_order_seq_cst.__int_type load (memory_order __m=memory_order_seq_cst) const volatile noexceptβconst volatileload, same default.void notify_all () const noexceptβ wake everybody up. main character energy. πvoid notify_one () const noexceptβ wake exactly one. mysterious. β¨operator __int_type () const noexceptβ implicit conversion into__int_type,const.operator __int_type () const volatile noexceptβ theconst volatileconversion twin.__int_type operator&= (__int_type __i) noexceptβ&=assignment operator, gives you back an__int_type.__int_type operator&= (__int_type __i) volatile noexceptβvolatile&=.__int_type operator++ () noexceptβ prefix increment, returns the__int_type.__int_type operator++ () volatile noexceptβ prefix increment,volatile.__int_type operator++ (int) noexceptβ postfix increment (that littleintdummy argument), returns the__int_type.__int_type operator++ (int) volatile noexceptβ postfix increment,volatile.__int_type operator+= (__int_type __i) noexceptβ+=that hands back an__int_type.__int_type operator+= (__int_type __i) volatile noexceptβvolatile+=.__int_type operator-- () noexceptβ prefix decrement.__int_type operator-- () volatile noexceptβ prefix decrement,volatile.__int_type operator-- (int) noexceptβ postfix decrement, with theintmarker.__int_type operator-- (int) volatile noexceptβ postfix decrement,volatile.__int_type operator-= (__int_type __i) noexceptβ-=, returns__int_type.__int_type operator-= (__int_type __i) volatile noexceptβvolatile-=.__int_type operator= (__int_type __i) noexceptβ assign a raw__int_typein, get an__int_typeout.__int_type operator= (__int_type __i) volatile noexceptβvolatileassignment of the raw type.__atomic_base & operator= (const __atomic_base &) volatile=deleteβ assignment from another__atomic_base? deleted, andvolatiletoo. nope. π__atomic_base & operator= (const __atomic_base &)=deleteβ also deleted, the non-volatile one. you literally cannot do this, fr fr.__int_type operator^= (__int_type __i) noexceptβ^=, returns__int_type.__int_type operator^= (__int_type __i) volatile noexceptβvolatile^=.__int_type operator|= (__int_type __i) noexceptβ|=, returns__int_type.__int_type operator|= (__int_type __i) volatile noexceptβvolatile|=.void store (__int_type __i, memory_order __m=memory_order_seq_cst) noexceptβ write a value in, memory order defaults tomemory_order_seq_cst.void store (__int_type __i, memory_order __m=memory_order_seq_cst) volatile noexceptβvolatilestore, same default, samenoexcept.void wait (__int_type __old, memory_order __m=memory_order_seq_cst) const noexceptβ wait around for a change,const, memory order defaulting tomemory_order_seq_cst. π
πΈ Detailed Description πΈ
okay so the actual declaration, verbatim, and yes there's a stray little " in there and we are keeping her exactly as she is, she's part of the lore: π
template<typename _ITp>
struct std::__atomic_base< _ITp >" Base class for atomic integrals.
Definition at line 324 of file atomic_base.h. π
π«Ά Author π«Ά
Generated automatically by Doxygen for libstdc++ from the source code. yes bestie, a robot wrote it, and honestly? she ate. β¨
and that's the whole page, no notes π
β this was libstdc++, dated Sat Mar 19 2022, from the std::__atomic_base< _ITp >(3cxx) manual. go forth and be atomic, periodt. πβπ
π¦ where this page comes from
- ubuntu jammy: libstdc++-12-doc 12-20220319-1ubuntu1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms