std::pmr:: operator==, std::pmr:: operator!=
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Member functions | ||||
|
(
C++20/26*
)
|
||||
| Non-member functions | ||||
|
operator==
operator!=
(until C++20)
|
|
定义于头文件
<memory_resource>
|
||
|
template
<
class
T1,
class
T2
>
bool
operator
==
(
const
std::
pmr
::
polymorphic_allocator
<
T1
>
&
lhs,
|
(1) | (C++17 起) |
|
friend
bool
operator
==
(
const
polymorphic_allocator
&
lhs,
const polymorphic_allocator & rhs ) noexcept ; |
(2) | (C++17 起) |
|
template
<
class
T1,
class
T2
>
bool
operator
!
=
(
const
std::
pmr
::
polymorphic_allocator
<
T1
>
&
lhs,
|
(3) |
(C++17 起)
(C++20 前) |
|
friend
bool
operator
!
=
(
const
polymorphic_allocator
&
lhs,
const polymorphic_allocator & rhs ) noexcept ; |
(4) |
(C++17 起)
(C++20 前) |
比较两个多态分配器。若两个多态分配器的基础内存资源比较结果相等,则这两个分配器比较结果相等。
polymorphic_allocator
。
此函数对普通的 非限定查找 或 限定查找 不可见,仅当 std::pmr::polymorphic_allocator 作为参数的关联类时,才能通过 实参依赖查找 找到。
polymorphic_allocator
。
此函数对普通的 非限定查找 或 限定查找 不可见,仅当 std::pmr::polymorphic_allocator 作为参数关联类时,才能通过 实参依赖查找 找到。
|
|
(since C++20) |
参数
| lhs, rhs | - | 待比较的多态分配器 |
返回值
缺陷报告
下列行为变更缺陷报告被追溯应用于先前发布的 C++ 标准。
| DR | 适用范围 | 发布时的行为 | 正确行为 |
|---|---|---|---|
| LWG 3683 | C++17 |
polymorphic_allocator
无法与可转换至该类型的其他类型进行比较
|
已添加重载 |