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 at value_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, is constexpr, is noexcept. 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, __m1 and __m2. πŸ’ͺ
  • bool compare_exchange_strong (__int_type &__i1, __int_type __i2, memory_order __m1, memory_order __m2) volatile noexcept β€” same thing but volatile, 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 to memory_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 her volatile counterpart, 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, __m1 and __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 defaulted memory_order_seq_cst.
  • bool compare_exchange_weak (__int_type &__i1, __int_type __i2, memory_order __m=memory_order_seq_cst) volatile noexcept β€” and the volatile one. 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 to memory_order_seq_cst.
  • __int_type exchange (__int_type __i, memory_order __m=memory_order_seq_cst) volatile noexcept β€” volatile edition, 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, volatile flavour.
  • __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 β€” the volatile AND.
  • __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 β€” volatile OR.
  • __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, but volatile.
  • __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 β€” volatile XOR, 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 volatile this time.
  • __int_type load (memory_order __m=memory_order_seq_cst) const noexcept β€” read the value out, const, memory order defaults to memory_order_seq_cst.
  • __int_type load (memory_order __m=memory_order_seq_cst) const volatile noexcept β€” const volatile load, 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 β€” the const volatile conversion 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 little int dummy 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 the int marker.
  • __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_type in, get an __int_type out.
  • __int_type operator= (__int_type __i) volatile noexcept β€” volatile assignment of the raw type.
  • __atomic_base & operator= (const __atomic_base &) volatile=delete β€” assignment from another __atomic_base? deleted, and volatile too. 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 to memory_order_seq_cst.
  • void store (__int_type __i, memory_order __m=memory_order_seq_cst) volatile noexcept β€” volatile store, same default, same noexcept.
  • void wait (__int_type __old, memory_order __m=memory_order_seq_cst) const noexcept β€” wait around for a change, const, memory order defaulting to memory_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