std::atomic_fetch_xor_explicit
| Defined in header <atomic> |  |  | 
|---|---|---|
|  | (1) | (since C++11) | 
| template< class Integral > Integral atomic_fetch_xor( std::atomic<Integral>* obj, Integral arg ); |  | |
| template< class Integral > Integral atomic_fetch_xor( volatile std::atomic<Integral>* obj, Integral arg ); |  | |
|  | (2) | (since C++11) | 
| template< class Integral > Integral atomic_fetch_xor_explicit( std::atomic<Integral>* obj, Integral arg, std::memory_order order ); |  | |
| template< class Integral > Integral atomic_fetch_xor_explicit( volatile std::atomic<Integral>* obj, Integral arg, std::memory_order order ); |  | 
原子地替换obj的旧值之间的按位异或的结果。obj和arg返回值obj以前持有。
执行该操作时,就好像执行了以下操作一样:
1%29obj->fetch_xor(arg)
2%29obj->fetch_xor(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 | - | the memory sycnhronization ordering for this operation: all values are permitted. | 
返回值
中此函数的效果之前的值。修改顺序成*obj...
例外
noexcept规格:
noexcept
可能的实施
模板<class T>TypeName STD::Enable[医]如果<std::is[医]积分<T>*价值&%21 std::is[医]相同<T,bool>::value,T>:type原子[医]去取[医]XOR%28 STD::原子<T>%2AOBJ,T Arg%29;{返回obj->提取[医]XOR%28 arg%29;}
*。
例
另见
| fetch_xor | atomically performs bitwise XOR between the argument and the value of the atomic object and obtains the value held previously (public member function of std::atomic) | 
|---|---|
| atomic_fetch_oratomic_fetch_or_explicit (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 (function template) | 
| atomic_fetch_andatomic_fetch_and_explicit (C++11)(C++11) | replaces the atomic object with the result of logical AND with a non-atomic argument and obtains the previous value of the atomic (function template) | 
C原子文档[医]去取[医]异或,原子[医]去取[医]异或[医]显式
 © cppreference.com在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。
本文档系腾讯云开发者社区成员共同维护,如有问题请联系 cloudcommunity@tencent.com

