std::atomic_ref::fetch_or(3)

πŸ“¦ version 2024.07.05, in nixpkgs unstable, opensuse-leap 16.0

πŸ’… std::atomic_ref::fetch_or(3) πŸ’…

okay so bestie, welcome to the manual page for std::atomic_ref::fetch_or, straight outta the C++ Standard Libary (yes, that spelling is doing its own thing 😭). it's giving atomic-OR main character energy, and we're gonna get you comfy with it. no cap.

🌸 NAME 🌸

std::atomic_ref::fetch_or - std::atomic_ref::fetch_or

πŸ¦‹ Synopsis πŸ¦‹

member only of atomic_ref<Integral> specializations

T fetch_or( T arg,
            std::memory_order order = std::memory_order_seq_cst )

(since C++20)

const noexcept;

so what's the tea? it atomically replaces the current value of the referenced object with the result of bitwise OR of the value and arg. this operation is a read-modify-write operation, periodt. memory is affected according to the value of order. ✨

πŸ’– Parameters πŸ’–

  • arg β€” the other argument of bitwise OR. literally the other side of the OR moment 🫢
  • order β€” memory order constraints to enforce. the vibe check for memory ordering πŸ’…

✨ Return value ✨

the value of the referenced object, immediately preceding the effects of this function. iykyk β€” it's the value from right before this function did its thing 😭


cute sign-off, bestie: source/version/date = http://cppreference.com Β· 2024.06.10 πŸŽ€ mwah πŸ’‹

πŸ“¦ where this page comes from