operator==, <=> (std::indirect)
|
定义于头文件
<memory>
|
||
|
比较两个
indirect
对象
|
||
|
template
<
class
U,
class
A
>
constexpr
bool
operator
==
(
const
indirect
&
lhs,
const
indirect
<
U, A
>
&
rhs
)
|
(1) | (C++26 起) |
|
template
<
class
U,
class
A
>
constexpr
/*synth-three-way-result*/
<
T, U
>
|
(2) | (C++26 起) |
|
比较
indirect
对象与值
|
||
|
template
<
class
U
>
constexpr
bool
operator
==
(
const
indirect
&
ind,
const
U
&
value
)
|
(3) | (C++26 起) |
|
template
<
class
U
>
constexpr
/*synth-three-way-result*/
<
T, U
>
|
(4) | (C++26 起) |
对
indirect
对象执行比较操作。
关于 /*synth-three-way-result*/ 的定义,请参见 synth-three-way-result 。
indirect
对象,比较结果定义如下:
| lhs | 无值状态 | 非无值状态 | ||
|---|---|---|---|---|
| rhs | 无值状态 | 非无值状态 | 无值状态 | 非无值状态 |
| operator == | true | false | false | * lhs == * rhs |
| operator <=> |
!
lhs.
valueless_after_move
(
)
<=>
! rhs. valueless_after_move ( ) |
synth-three-way
(
*
lhs,
*
rhs
)
|
||
indirect
对象与值进行比较,比较结果定义如下:
| 运算符 | ind 为无值状态 | ind 非无值状态 |
|---|---|---|
| operator == | false | * ind == value |
| operator <=> | std :: strong_ordering :: less | synth-three-way ( * ind, value ) |
参数
| lhs, rhs, ind | - |
要比较的
indirect
对象
|
| value | - | 与所持有值进行比较的值 |
返回值
如上所述。
示例
|
本节内容不完整
原因:缺少示例 |