Spec-Zone.ru › C++

operator==,!=(std::allocator)

template< class T1, class T2 >
bool operator==( const allocator<T1>& lhs, const allocator<T2>& rhs ) throw();
(1) (до 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
    operator==( const allocator<T1>& lhs, const allocator<T2>& rhs ) noexcept;
(начиная с C++20)
template< class T1, class T2 >
bool operator!=( const allocator<T1>& lhs, const allocator<T2>& rhs ) throw();
(2) (до 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.

Оператор != синтезируется на основе operator==.

(начиная с C++20)

Параметры

lhs, rhs - распределители по умолчанию для сравнения

Возвращаемое значение

1) true
2) false

© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
https://en.cppreference.com/cpp/memory/allocator/operator_cmp

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API