std::atomic::load
STD::原子::LOAD
| | (since C++11) |
---|---|---|
T load( std::memory_order order = std::memory_order_seq_cst ) const; | | |
T load( std::memory_order order = std::memory_order_seq_cst ) const volatile; | | |
原子加载并返回原子变量的当前值。的值影响内存。order
...
order
一定是std::memory_order_relaxed
,,,std::memory_order_consume
,,,std::memory_order_acquire
或std::memory_order_seq_cst
否则,行为是未定义的。
参数
order | - | memory order constraints to enforce |
---|
返回值
原子变量的当前值。
例外
noexcept
规格:
noexcept
另见
operator T | loads a value from an atomic object (public member function) |
---|---|
atomic_loadatomic_load_explicit (C++11)(C++11) | atomically obtains the value stored in an atomic object (function template) |
© cppreference.com
在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。