P4221R3 — Atomic Compare
LEWG
This paper proposes adding a `compare_load` member function to `std::atomic<T>` and `std::atomic_ref<T>`, alongside corresponding free functions. This function performs an atomic comparison of the atomic object's value with an expected value, following the same value representation comparison semantics as `compare_exchange_strong`. It updates the expected argument on failure, operating entirely as a pure read without writing a new value to the atomic object.