atomic_compare_exchange_weak Function

Performs a weak atomic compare and exchange operation.

template <class Ty>
inline bool atomic_compare_exchange_strong(
   volatile atomic<Ty> *Atom,
   Ty *Exp,
   Ty Value
) _NOEXCEPT;
template <class Ty>
inline bool atomic_compare_exchange_strong(
   atomic<Ty> *Atom,
   Ty *Exp,
   TyValue
) _NOEXCEPT;

Parameters

  • Atom
    A pointer to an atomic object that stores a value of type Ty.

  • Exp
    A pointer to a value of type Ty.

  • Value
    A value of type Ty.

Return Value

A bool that indicates the result of the value comparison.

Remarks

This method performs a weak atomic compare and exchange operation that has implicit memory_order_seq_cstmemory_order arguments. For more information, see atomic_compare_exchange_weak_explicit Function.

Requirements

Header: atomic

Namespace: std

See Also

Reference

<atomic>

atomic Structure