std::pmr::operator==, std::pmr::operator!=
From cppreference.com
< cpp | memory | polymorphic allocator
| ヘッダ <memory_resource> で定義 |
||
| template< class T1, class T2 > bool operator==( const std::pmr::polymorphic_allocator<T1>& lhs, |
(1) | (C++17以降) |
| friend bool operator==( const polymorphic_allocator& lhs, const polymorphic_allocator& rhs ) noexcept; |
(2) | (C++17以降) |
| template< class T1, class T2 > bool operator!=( const std::pmr::polymorphic_allocator<T1>& lhs, |
(3) | (C++17以降) (C++20まで) |
| friend bool operator!=( const polymorphic_allocator& lhs, const polymorphic_allocator& rhs ) noexcept; |
(4) | (C++17以降) (C++20まで) |
2つのポリモーフィックアロケータを比較します。2つのポリモーフィックアロケータは、それらの基になるメモリリソースが比較されて等しい場合に等しいとみなされます。
1) *lhs.resource() == *rhs.resource() を返します。
2) (1) と同じです。
この関数は、通常の 修飾なし または 修飾あり の名前探索では見えず、std::pmr::polymorphic_allocator が引数の関連クラスである場合にのみ 引数依存の名前探索 によって見つけることができます。
polymorphic_allocator への変換を許可します。この関数は、通常の 修飾なし または 修飾あり の名前探索では見えず、std::pmr::polymorphic_allocator が引数の関連クラスである場合にのみ 引数依存の名前探索 によって見つけることができます。
3) !(lhs == rhs) を返します。
4) (3) と同じです。
この関数は、通常の 修飾なし または 修飾あり の名前探索では見えず、std::pmr::polymorphic_allocator が引数の関連クラスである場合にのみ 引数依存の名前探索 によって見つけることができます。
polymorphic_allocator への変換を許可します。この関数は、通常の 修飾なし または 修飾あり の名前探索では見えず、std::pmr::polymorphic_allocator が引数の関連クラスである場合にのみ 引数依存の名前探索 によって見つけることができます。
|
|
(C++20以降) |
[編集] パラメータ
| lhs, rhs | - | 比較するポリモーフィックアロケータ |
[編集] 戻り値
1,2) *lhs.resource() == *rhs.resource()
3,4) !(lhs == rhs)
[編集] 不具合報告
以下の動作変更を伴う欠陥報告が、以前に公開されたC++標準に遡って適用されました。
| DR | 適用対象 | 公開された動作 | 正しい動作 |
|---|---|---|---|
| LWG 3683 | C++17 | polymorphic_allocator を、それに変換可能な型と比較できなかった |
オーバーロードが追加された |