std::atomic::store
STD::原子::存储
| | (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_release
或std::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) |
© cppreference.com
在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。