名前空間
変種
操作

std::owner_less

提供: cppreference.com
< cpp‎ | memory
 
 
ユーティリティライブラリ
汎用ユーティリティ
日付と時間
関数オブジェクト
書式化ライブラリ (C++20)
(C++11)
関係演算子 (C++20で非推奨)
整数比較関数
(C++20)
スワップと型操作
(C++14)
(C++11)
(C++11)
(C++11)
(C++17)
一般的な語彙の型
(C++11)
(C++17)
(C++17)
(C++17)
(C++17)

初等文字列変換
(C++17)
(C++17)
 
動的メモリ管理
スマートポインタ
(C++11)
(C++11)
(C++11)
(C++17未満)
(C++11)
アロケータ
メモリリソース
未初期化記憶域
ガベージコレクションサポート
その他
(C++20)
(C++11)
(C++11)
C のライブラリ
低水準のメモリ管理
 
ヘッダ <memory> で定義
template<>
struct owner_less<void>;
(C++17以上)

std::owner_less<>std::owner_less の引数の型を推定する特殊化です。

目次

[編集] メンバ型

メンバ型 定義
is_transparent /* unspecified */

[編集] ノート

メンバ型 is_transparent はこの関数オブジェクトが透過的な関数オブジェクトである、つまり、任意の型の引数を受理し、不均一な分脈や右辺値引数で使用されたときに不要なコピーや変換を回避する完全転送を使用することを、呼び出し元に示します。 特に、 std::set::findstd::set::lower_bound のようなテンプレート関数は Compare 型についてこのメンバ型を使用します。

[編集] メンバ関数

operator()
オーナーベースのセマンティクスを用いて引数を比較します
(関数)

std::owner_less<void>::operator()

template<class T, class U>

bool operator()( const std::shared_ptr<T>& lhs,

                 const std::shared_ptr<U>& rhs ) const noexcept;
(C++17以上)
template<class T, class U>

bool operator()( const std::shared_ptr<T>& lhs,

                 const std::weak_ptr<U>& rhs ) const noexcept;
(C++17以上)
template<class T, class U>

bool operator()( const std::weak_ptr<T>& lhs,

                 const std::shared_ptr<U>& rhs ) const noexcept;
(C++17以上)
template<class T, class U>

bool operator()( const std::weak_ptr<T>& lhs,

                 const std::weak_ptr<U>& rhs ) const noexcept;
(C++17以上)

オーナーベースのセマンティクスを用いて lhsrhs を比較します。 実質的に lhs.owner_before(rhs) を呼びます。

順序は狭義弱順序関係です。

lhsrhs はどちらも空であるか所有権を共有する場合にのみ同等です。

引数

lhs, rhs - 比較する共有所有権のポインタ

戻り値

オーナーベースの順序付けによって決定されるところによって lhsrhs より小さい場合は true


[編集] 関連項目

shared_ptr のオーナーベースの順序付けを提供します
(std::shared_ptr<T>のパブリックメンバ関数) [edit]
weak_ptr のオーナーベースの順序付けを提供します
(std::weak_ptr<T>のパブリックメンバ関数) [edit]