operator==,!=(std::allocator)
From cppreference.com
C++
Feature test macros (C++20)
Concepts library (C++20)
Metaprogramming library (C++11)
Ranges library (C++20)
Filesystem library (C++17)
Concurrency support library (C++11)
Execution control library (C++26)
Memory management library
(exposition only*)
(C++11)
(C++23)
(C++11)
(C++17)
(C++11)
(C++11)
(C++20)
(C++20)
(C++17)
(C++11)
(C++17)
(C++20)
(C++17)
(C++17)
(C++17)
(C++17)
(C++17)
(C++17)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++17)
(C++17)
(C++17)
(C++17)
(C++17)
(C++17)
(C++17)
(C++17)
Uninitialized storage (until C++20)
(until C++20*)
(until C++20*)
(until C++20*)
Garbage collector support (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)
(C++11)(until C++23)
(C++11)
(C++11)
(C++17)
(C++20)
(C++17)
(C++11)
(C++11)
(C++11)
(until C++17*)
(C++11)
(C++17)
(C++26)
(C++26)
(C++11)
(C++11)
(C++11)
(C++23)
(C++23)
(C++11)
(C++20)
(C++11)
(C++11)
(C++20)
(C++26)
std::allocator
Member functions
(until C++20)
(C++23)
(until C++20)
(until C++20)
(until C++20)
Non-member functions
operator==operator!=
(until C++20)
(1)
template< class T1, class T2 >
bool operator==( const allocator<T1>& lhs, const allocator<T2>& rhs ) throw();
(until C++11)
bool operator==( const allocator<T1>& lhs, const allocator<T2>& rhs ) throw();
template< class T1, class T2 >
bool operator==( const allocator<T1>& lhs, const allocator<T2>& rhs ) noexcept;
(since C++11) bool operator==( const allocator<T1>& lhs, const allocator<T2>& rhs ) noexcept;
(until C++20)
template< class T1, class T2 >
(since C++20)
constexpr bool
(2)
template< class T1, class T2 >
bool operator!=( const allocator<T1>& lhs, const allocator<T2>& rhs ) throw();
(until C++11)
bool operator!=( const allocator<T1>& lhs, const allocator<T2>& rhs ) throw();
template< class T1, class T2 >
bool operator!=( const allocator<T1>& lhs, const allocator<T2>& rhs ) noexcept;
(since C++11) bool operator!=( const allocator<T1>& lhs, const allocator<T2>& rhs ) noexcept;
(until C++20)
Compares two default allocators. Since default allocators are stateless, two default allocators are always equal.
1) Returns true.
2) Returns false.
The !=
operator is synthesized from operator==
.
[edit] Parameters
lhs, rhs
-
default allocators to compare
[edit] Return value
1) true
2) false