std::atomic_fetch_or, std::atomic_fetch_or_explicit
来自cppreference.com
|
|
该页由英文版wiki使用Google Translate机器翻译而来。
该翻译可能存在错误或用词不当。鼠标停留在文本上可以看到原版本。你可以帮助我们修正错误或改进翻译。参见说明请点击这里. |
| 在头文件 <atomic> 中定义
|
||
| template< class Integral > Integral atomic_fetch_or( std::atomic<Integral>* obj, Integral arg ); |
(1) | (C++11 起) |
| template< class Integral > Integral atomic_fetch_or( volatile std::atomic<Integral>* obj, Integral arg ); |
(2) | (C++11 起) |
| template< class Integral > Integral atomic_fetch_or_explicit( std::atomic<Integral>* obj, Integral arg, |
(3) | (C++11 起) |
| template< class Integral > Integral atomic_fetch_or_explicit( volatile std::atomic<Integral>* obj, Integral arg, |
(4) | (C++11 起) |
原子取代所指向的数值
3-4) arg的结果按位OR之间的旧值objarg,并返回值obj举行之前,如果由obj->fetch_and(arg)原文:
Atomically replaces the value pointed by
arg with the result of bitwise OR between the old value of obj and arg, and returns the value obj held previously, as if by obj->fetch_and(arg)原子取代所指向的数值
arg的结果按位OR之间的旧值objarg,并返回值obj举行之前,如果由obj->fetch_and(arg, order)原文:
Atomically replaces the value pointed by
arg with the result of bitwise OR 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 OR 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_or( std::atomic<T>* obj, T arg ); { return obj->fetch_or(arg); } |
[编辑] 示例
| 本章尚未完成 原因:暂无示例 |
[编辑] 另请参阅
| (C++11) |
atomically performs bitwise OR between the argument and the value of the atomic object and obtains the value held previously (公共成员函数of std::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++11) (C++11) |
取代的原子的对象与非原子参数的逻辑异或的结果和获得原子的先前的值 原文: replaces the atomic object with the result of logical XOR with a non-atomic argument and obtains the previous value of the atomic (函数模板) |
| C documentation for atomic_fetch_or, atomic_fetch_or_explicit
| |