std::atomic_fetch_xor, std::atomic_fetch_xor_explicit
来自cppreference.com
|
|
该页由英文版wiki使用Google Translate机器翻译而来。
该翻译可能存在错误或用词不当。鼠标停留在文本上可以看到原版本。你可以帮助我们修正错误或改进翻译。参见说明请点击这里. |
| 在头文件 <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, |
(3) | (C++11 起) |
| template< class Integral > Integral atomic_fetch_xor_explicit( volatile std::atomic<Integral>* obj, Integral arg, |
(4) | (C++11 起) |
原子取代的
3-4) arg岁之间的值按位异或的结果所指向的数值objarg,并返回值obj举行之前,如果由obj->fetch_and(arg)原文:
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)原子取代的
arg岁之间的值按位异或的结果所指向的数值objarg,并返回值obj举行之前,如果由obj->fetch_and(arg, order)原文:
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)目录 |
[编辑] 参数
| obj | - | 指针的原子对象修改
原文: pointer to the atomic object to modify |
| arg | - | 值的原子对象中存储的值按位异或
原文: the value to bitwise XOR to the value stored in the atomic object |
| order | - | 的的内存sycnhronization订购此操作:所有的允许值.
原文: the memory sycnhronization ordering for this operation: all values are permitted. |
[编辑] 返回值
以前保存的值的原子对象所指向的
obj原文:
The value held previously by the atomic object pointed to by
obj[编辑] 例外
[编辑] 可能的实现
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) |
以原子方式执行按位异或的原子对象之间的参数的值,并获得先前保存的值 原文: atomically performs bitwise XOR between the argument and the value of the atomic object and obtains the value held previously (公共成员函数of std::atomic)
|
| (C++11) (C++11) |
取代的原子的对象的逻辑结果,或与非原子参数获得原子的先前的值 原文: replaces the atomic object with the result of logical OR with a non-atomic argument and obtains the previous value of the atomic (函数模板) |
| (C++11) (C++11) |
取代的原子的对象与结果的逻辑AND(与),带的非原子参数和获得原子的先前的值 原文: replaces the atomic object with the result of logical AND with a non-atomic argument and obtains the previous value of the atomic (函数模板) |
| C documentation for atomic_fetch_xor, atomic_fetch_xor_explicit
| |