operator==,!=(std::allocator)
來自 cppreference.com
(1) | ||
template< class T1, class T2 > bool operator==( const allocator<T1>& lhs, const allocator<T2>& rhs ) throw(); |
(C++11 前) | |
template< class T1, class T2 > bool operator==( const allocator<T1>& lhs, const allocator<T2>& rhs ) noexcept; |
(C++11 起) (C++20 前) |
|
template< class T1, class T2 > constexpr bool |
(C++20 起) | |
(2) | ||
template< class T1, class T2 > bool operator!=( const allocator<T1>& lhs, const allocator<T2>& rhs ) throw(); |
(C++11 前) | |
template< class T1, class T2 > bool operator!=( const allocator<T1>& lhs, const allocator<T2>& rhs ) noexcept; |
(C++11 起) (C++20 前) |
|
比較兩個預設分配器。因為預設分配器是無狀態的,所以兩個預設分配器始終相等。
1) 返回 true。
2) 返回 false。
|
(C++20 起) |
[編輯] 引數
lhs, rhs | - | 要比較的預設分配器 |
[編輯] 返回值
1) true
2) false