std::indirect<T, Allocator>:: operator=
|
constexpr
indirect
&
operator
=
(
const
indirect
&
other
)
;
|
(1) | (自 C++26 起) |
|
constexpr
indirect
&
operator
=
(
indirect
&&
other
)
noexcept
(
/* 见下文 */
)
;
|
(2) | (自 C++26 起) |
|
template
<
class
U
=
T
>
constexpr indirect & operator = ( U && value ) ; |
(3) | (自 C++26 起) |
将 * this 的内容替换为 value 或 other 的内容。
令
traits
为
std::
allocator_traits
<
Allocator
>
:
alloc
通过
std::
forward
<
U
>
(
value
)
构造持有对象。否则,等价于执行
**
this
=
std::
forward
<
U
>
(
value
)
。
- std:: is_same_v < std:: remove_cvref_t < U > , std :: indirect > 为 false 。
- std:: is_constructible_v < T, U > 为 true 。
- std:: is_assignable_v < T & , U > 为 true 。
目录 |
参数
| other | - |
另一个
indirect
对象,其拥有的值(若存在)将用于赋值
|
| value | - | 用于赋值或构造所拥有值的值 |
返回值
* this
异常
T
的选定复制构造函数期间抛出异常,则无任何效果。
propagate_on_container_move_assignment
::
value
示例
|
本节内容不完整
原因:缺少示例 |