Пространства имён
Варианты
Действия

std::atomic_fetch_and, std::atomic_fetch_and_explicit

Материал из cppreference.com

Заголовочный файл <atomic>
template< class Integral >
Integral atomic_fetch_and( std::atomic<Integral>* obj, Integral arg );
(1) (начиная с C++11)
template< class Integral >
Integral atomic_fetch_and( volatile std::atomic<Integral>* obj, Integral arg );
(2) (начиная с C++11)
template< class Integral >

Integral atomic_fetch_and_explicit( std::atomic<Integral>* obj, Integral arg,

                                    std::memory_order order);
(3) (начиная с C++11)
template< class Integral >

Integral atomic_fetch_and_explicit( volatile std::atomic<Integral>* obj, Integral arg,

                                    std::memory_order order);
(4) (начиная с C++11)
1-2)
Атомарно заменяет значение указано на arg с результатом побитового И между старым значением obj и arg, и возвращает значение obj состоялась ранее, как по obj->fetch_and(arg)
Original:
Atomically replaces the value pointed by arg with the result of bitwise AND between the old value of obj and arg, and returns the value obj held previously, as if by obj->fetch_and(arg)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
3-4)
Атомарно заменяет значение указано на arg с результатом побитового И между старым значением obj и arg, и возвращает значение obj состоялась ранее, как по obj->fetch_and(arg, order)
Original:
Atomically replaces the value pointed by arg with the result of bitwise AND between the old value of obj and arg, and returns the value obj held previously, as if by obj->fetch_and(arg, order)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Содержание

[править] Параметры

obj -
Указатель на атомном объекте изменить
Original:
pointer to the atomic object to modify
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
arg -
значение побитовое И со значением, хранящимся в атомном объекте
Original:
the value to bitwise AND to the value stored in the atomic object
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
order -
памяти, синхронизация заказов для этой операции: все допустимые значения .
Original:
the memory synchronization ordering for this operation: all values are permitted.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[править] Возвращаемое значение

Значение состоялась ранее атомный объект, на который указывает obj
Original:
The value held previously by the atomic object pointed to by obj
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[править] Исключения

noexcept-спецификация:  
noexcept
  (начиная с C++11)

[править] Возможная реализация

template< class T >
typename std::enable_if<std::is_integral<T>::value && !std::is_same<T, bool>::value, T>::type
    atomic_fetch_and(std::atomic<T>* obj, T arg);
{
    return obj->fetch_and(arg);
}

[править] Пример

[править] См. также

(C++11)
атомарно выполняет побитовое И между аргументом и значением атомного объекта и получает значение состоявшейся ранее
Original:
atomically performs bitwise AND between the argument and the value of the atomic object and obtains the value held previously
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(public функция-член std::atomic) [edit]
заменяет атомного объекта с результатом логического ИЛИ с неатомической аргумента и получает предыдущее значение атомной
Original:
replaces the atomic object with the result of logical OR with a non-atomic argument and obtains the previous value of the atomic
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(шаблон функции) [edit]
заменяет атомного объекта с результатом логического XOR с неатомической аргумента и получает предыдущее значение атомной
Original:
replaces the atomic object with the result of logical XOR with a non-atomic argument and obtains the previous value of the atomic
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(шаблон функции) [edit]
C документация для atomic_fetch_and, atomic_fetch_and_explicit