|
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Member functions | ||||
(C++20/26*) | ||||
| Non-member functions | ||||
operator==operator!= (until C++20) |
Defined in header <memory_resource> | ||
template<class T1,class T2> bool operator==(conststd::pmr::polymorphic_allocator<T1>& lhs, | (1) | (since C++17) |
friendbool operator==(const polymorphic_allocator& lhs, const polymorphic_allocator& rhs)noexcept; | (2) | (since C++17) |
template<class T1,class T2> bool operator!=(conststd::pmr::polymorphic_allocator<T1>& lhs, | (3) | (since C++17) (until C++20) |
friendbool operator!=(const polymorphic_allocator& lhs, const polymorphic_allocator& rhs)noexcept; | (4) | (since C++17) (until C++20) |
Compares two polymorphic allocators. Two polymorphic allocators compare equal if their underlying memory resource compares equal.
polymorphic_allocator.polymorphic_allocator.The | (since C++20) |
| lhs, rhs | - | polymorphic allocators to compare |
The following behavior-changing defect reports were applied retroactively to previously published C++ standards.
| DR | Applied to | Behavior as published | Correct behavior |
|---|---|---|---|
| LWG 3683 | C++17 | polymorphic_allocator could not be compared with types convertible to it | overload added |