在线文档教程
C++

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_acquirestd::memory_order_seq_cst否则,行为是未定义的。

参数

order-memory order constraints to enforce

返回值

原子变量的当前值。

例外

noexcept规格:

noexcept

另见

operator Tloads 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。

http://en.cpPreference.com/w/cpp/原子/LOAD