Difference between revisions of "cpp/memory/polymorphic allocator/operator eq"
From cppreference.com
< cpp | memory | polymorphic allocator
m (link to ja) |
(P1614R2) |
||
Line 2: | Line 2: | ||
{{cpp/memory/polymorphic_allocator/navbar}} | {{cpp/memory/polymorphic_allocator/navbar}} | ||
{{dcl begin}} | {{dcl begin}} | ||
− | {{dcl | 1= | + | {{dcl header | memory_resource}} |
+ | {{dcl | since=c++17 | num=1 | 1= | ||
template< class T1, class T2 > | template< class T1, class T2 > | ||
bool operator==( const std::pmr::polymorphic_allocator<T1>& lhs, | bool operator==( const std::pmr::polymorphic_allocator<T1>& lhs, | ||
const std::pmr::polymorphic_allocator<T2>& rhs ) noexcept; | const std::pmr::polymorphic_allocator<T2>& rhs ) noexcept; | ||
}} | }} | ||
− | {{dcl | 1= | + | {{dcl | since=c++17 | until=c++20 | num=2 | 1= |
template< class T1, class T2 > | template< class T1, class T2 > | ||
bool operator!=( const std::pmr::polymorphic_allocator<T1>& lhs, | bool operator!=( const std::pmr::polymorphic_allocator<T1>& lhs, |
Revision as of 06:45, 27 January 2020
Defined in header <memory_resource>
|
||
template< class T1, class T2 > bool operator==( const std::pmr::polymorphic_allocator<T1>& lhs, |
(1) | (since C++17) |
template< class T1, class T2 > bool operator!=( const std::pmr::polymorphic_allocator<T1>& lhs, |
(2) | (since C++17) (until C++20) |
Compares two polymorphic allocators. Two polymorphic allocators compare equal if their underlying memory resource compares equal.
1) Returns *lhs.resource() == *rhs.resource()
2) Returns !(lhs == rhs)
Parameters
lhs, rhs | - | polymorphic allocators to compare |
Return value
1) *lhs.resource() == *rhs.resource()
2) !(lhs == rhs)