名前空間
変種
操作

std::owner_less

From cppreference.com
< cpp‎ | memory
 
 
メモリ管理ライブラリ
(説明用*)
未初期化メモリのアルゴリズム
(C++17)
(C++17)
(C++17)
制約付き未初期化
メモリアルゴリズム
Cライブラリ

アロケータ
メモリリソース
ガベージコレクションのサポート
(C++11)(C++23まで)
(C++11)(C++23まで)
(C++11)(C++23まで)
(C++11)(C++23まで)
(C++11)(C++23まで)
(C++11)(C++23まで)
未初期化ストレージ
(C++20まで*)
(C++20まで*)
明示的な生存期間管理
 
ヘッダ <memory> で定義
template<>
struct owner_less<void>;
(C++17以降)

std::owner_less<void> は、パラメータ型が推論される std::owner_less の特殊化です。

目次

[編集] ネストされた型

ネストされた型 定義
is_transparent unspecified

[編集] メンバ関数

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

[編集] 注釈

機能テストマクロ 規格 機能
__cpp_lib_transparent_operators 201510L (C++17) 透過的な std::owner_lessstd::owner_less<void>

[編集] 関連項目

共有ポインタの所有者ベースの順序を提供します
(std::shared_ptr<T> のパブリックメンバ関数) [編集]
weak pointer の所有者ベースの順序付けを提供します
(std::weak_ptr<T> のパブリックメンバ関数) [編集]
English 日本語 中文(简体) 中文(繁體)