Share via


atomic_fetch_and 関数

値と atomic オブジェクトに格納されている既存の値にビットごとの and を実行します。

template <class T>
inline T atomic_fetch_and(
   volatile atomic<T>* Atom,
   T Value); noexcept

template <class T>
inline T atomic_fetch_and(
   volatile atomic<T>* Atom,
   T Value); noexcept

パラメーター

  • Atom
    T 型の値が格納された atomic オブジェクトへのポインター。

  • Value
    T 型の値。

戻り値

操作の直前にアトミック オブジェクトによって格納された値。

解説

atomic_fetch_and 関数は、memory_order_seq_cst memory_order 制約を使用して Atom の格納されている値を Value のビットごとの and と Atom に格納されている現在の値を置換する read-modify-write 操作を実行します。

必要条件

ヘッダー: atomic

名前空間: std

参照

関連項目

<atomic>

atomic 構造体

atomic_fetch_and_explicit 関数