std::atomic_ref<T>::operator=

来自cppreference.com
< cpp‎ | atomic‎ | atomic ref
 
 
并发支持库
线程
(C++11)
(C++20)
(C++20)
this_thread 命名空间
(C++11)
(C++11)
(C++11)
互斥
(C++11)
(C++11)  
通用锁管理
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
条件变量
(C++11)
信号量
闩与屏障
(C++20)
(C++20)
未来体
(C++11)
(C++11)
(C++11)
(C++11)
安全回收
(C++26)
(C++26)
风险指针





原子类型
(C++11)
(C++20)
原子类型的初始化
(C++11)(C++20 中弃用)
(C++11)(C++20 中弃用)
内存定序
原子操作的自由函数
原子标志的自由函数
 
 
T operator=( T desired ) const noexcept;
(1) (C++20 起)
atomic_ref& operator=( const atomic_ref& ) = delete;
(2) (C++20 起)
1) 原子地赋值 desired 给被引用对象。等价于 store(desired)

参数

desired - 要赋的值

返回值

desired

注解

不同于大多数赋值运算符,atomic_ref 的赋值运算符并不返回到其左侧操作数的引用。它代之以返回存储的值的副本。

参阅

构造 atomic_ref 对象
(公开成员函数)