Namespaces
Variants

std:: owner_less

From cppreference.net
Memory management library
( exposition only* )
Allocators
Uninitialized memory algorithms
Constrained uninitialized memory algorithms
Memory resources
Uninitialized storage (until C++20)
( until C++20* )
( until C++20* )
( until C++20* )

Garbage collector support (until C++23)
(C++11) (until C++23)
(C++11) (until C++23)
(C++11) (until C++23)
(C++11) (until C++23)
(C++11) (until C++23)
(C++11) (until C++23)
ヘッダーで定義 <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以降)

lhs rhs を所有権ベースのセマンティクスで比較します。実質的に lhs. owner_before ( rhs ) を呼び出します。

順序付けは狭義の弱順序関係です。

lhs rhs は、両方が空であるか、所有権を共有している場合にのみ等価です。

パラメータ

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

戻り値

true は、所有権ベースの順序付けによって lhs より小さい rhs である場合に返されます。

注記

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

関連項目

共有ポインタの所有者ベースの順序付けを提供
( std::shared_ptr<T> の公開メンバ関数)
弱参照ポインタの所有者ベースの順序付けを提供
( std::weak_ptr<T> の公開メンバ関数)