std::atomic<T>:: operator T
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Member functions | ||||
|
atomic::operator T
|
||||
|
(C++20)
|
||||
|
(C++20)
|
||||
|
(C++20)
|
||||
| Constants | ||||
|
(C++17)
|
||||
| Specialized member functions | ||||
|
Specialized for integral,
floating-point (C++20) and pointer types |
||||
|
Specialized for integral and
pointer types only |
||||
|
(C++26)
|
||||
|
(C++26)
|
||||
| Specialized for integral types only | ||||
|
operator T
(
)
const
noexcept
;
|
(1) | (自 C++11 起) |
|
operator T
(
)
const
volatile
noexcept
;
|
(2) | (自 C++11 起) |
以原子方式加载并返回该原子变量的当前值。等价于 load ( ) 。
|
若 std:: atomic < T > :: is_always_lock_free 为 false 且重载 (2) 参与重载决议,则该用法被弃用。 |
(since C++20) |
参数
(无)
返回值
原子变量的当前值。
参见
|
原子地获取原子对象的值
(公开成员函数) |