Namespaces
Variants
Views
Actions

Difference between revisions of "cpp/memory/polymorphic allocator/operator eq"

From cppreference.com
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

 
 
Dynamic memory management
Uninitialized memory algorithms
Constrained uninitialized memory algorithms
Allocators
Garbage collection support
(C++11)(until C++23)
(C++11)(until C++23)
(C++11)(until C++23)
(C++11)(until C++23)
(C++11)(until C++23)
(C++11)(until C++23)



 
 
Defined in header <memory_resource>
template< class T1, class T2 >

bool operator==( const std::pmr::polymorphic_allocator<T1>& lhs,

                 const std::pmr::polymorphic_allocator<T2>& rhs ) noexcept;
(1) (since C++17)
template< class T1, class T2 >

bool operator!=( const std::pmr::polymorphic_allocator<T1>& lhs,

                 const std::pmr::polymorphic_allocator<T2>& rhs ) noexcept;
(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)