std::owner_less
提供: cppreference.com
ヘッダ <memory> で定義
|
||
template<> struct owner_less<void>; |
(C++17以上) | |
std::owner_less<> は std::owner_less の引数の型を推定する特殊化です。
目次 |
[編集] メンバ型
メンバ型 | 定義 |
is_transparent
|
/* unspecified */ |
[編集] ノート
メンバ型 is_transparent
はこの関数オブジェクトが透過的な関数オブジェクトである、つまり、任意の型の引数を受理し、不均一な分脈や右辺値引数で使用されたときに不要なコピーや変換を回避する完全転送を使用することを、呼び出し元に示します。 特に、 std::set::find や std::set::lower_bound のようなテンプレート関数は Compare
型についてこのメンバ型を使用します。
[編集] メンバ関数
operator() |
オーナーベースのセマンティクスを用いて引数を比較します (関数) |
std::owner_less<void>::operator()
template<class T, class U> bool operator()( const std::shared_ptr<T>& lhs, |
(C++17以上) | |
template<class T, class U> bool operator()( const std::shared_ptr<T>& lhs, |
(C++17以上) | |
template<class T, class U> bool operator()( const std::weak_ptr<T>& lhs, |
(C++17以上) | |
template<class T, class U> bool operator()( const std::weak_ptr<T>& lhs, |
(C++17以上) | |
オーナーベースのセマンティクスを用いて lhs
と rhs
を比較します。 実質的に lhs.owner_before(rhs) を呼びます。
順序は狭義弱順序関係です。
lhs
と rhs
はどちらも空であるか所有権を共有する場合にのみ同等です。
引数
lhs, rhs | - | 比較する共有所有権のポインタ |
戻り値
オーナーベースの順序付けによって決定されるところによって lhs
が rhs
より小さい場合は true。
[編集] 関連項目
shared_ptr のオーナーベースの順序付けを提供します ( std::shared_ptr<T> のパブリックメンバ関数)
| |
weak_ptr のオーナーベースの順序付けを提供します ( std::weak_ptr<T> のパブリックメンバ関数)
|