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

std::atomic_fetch_xor, std::atomic_fetch_xor_explicit

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

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

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

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

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

                                    std::memory_order order );
(4) (начиная с C++11)
1-2)
Атомарно заменяет значение указано на arg с результатом побитового XOR между старым значением obj и arg, и возвращает значение obj состоялась ранее, как по obj->fetch_and(arg)
Original:
Atomically replaces the value pointed by arg with the result of bitwise XOR 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 с результатом побитового XOR между старым значением obj и arg, и возвращает значение obj состоялась ранее, как по obj->fetch_and(arg, order)
Original:
Atomically replaces the value pointed by arg with the result of bitwise XOR 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 -
значение побитовое XOR со значением, хранящимся в атомном объекте
Original:
the value to bitwise XOR 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 -
памяти sycnhronization заказа для этой операции: все допустимые значения .
Original:
the memory sycnhronization 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_xor( std::atomic<T>* obj, T arg );
{
    return obj->fetch_xor(arg);
}

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

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

(C++11)
атомарно выполняет побитовое XOR между аргументом и значением атомного объекта и получает значение состоявшейся ранее
Original:
atomically performs bitwise XOR 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]
заменяет атомного объекта с результатом логического И с не-атомный аргумента и получает предыдущее значение атомной
Original:
replaces the atomic object with the result of logical AND 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_xor, atomic_fetch_xor_explicit