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

std::atomic::store

(since C++11)

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

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

原子化地将当前值替换为desired的值影响内存。order...

order一定是std::memory_order_relaxed,,,std::memory_order_releasestd::memory_order_seq_cst否则,行为是未定义的。

参数

desired

-

the value to store into the atomic variable

order

-

memory order constraints to enforce

返回值

%280%29

例外

noexcept规格:

noexcept

另见

operator=

stores a value into an atomic object (public member function)

atomic_storeatomic_store_explicit (C++11)(C++11)

atomically replaces the value of the atomic object with a non-atomic argument (function template)

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

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

扫码关注腾讯云开发者

领取腾讯云代金券