首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

std::atomic::exchange

?

?

(since C++11)

T exchange( T desired, std::memory_order order = std::memory_order_seq_cst );

?

?

T exchange( T desired, std::memory_order order = std::memory_order_seq_cst ) volatile;

?

?

原子化地将基础值替换为desired.操作是读-修改-写操作.。的值影响内存。order...

参数

desired

-

value to assign

order

-

memory order constraints to enforce

返回值

调用前原子变量的值。

例外

noexcept规格:

noexcept

另见

atomic_exchangeatomic_exchange_explicit (C++11)(C++11)

atomically replaces the value of the atomic object with non-atomic argument and returns the old value of the atomic (function template)

代码语言:txt
复制
 ? cppreference.com

在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。

扫码关注腾讯云开发者

领取腾讯云代金券

http://www.vxiaotou.com