std::owner_less
From cppreference.com
C++
Feature test macros (C++20)
Concepts library (C++20)
Metaprogramming library (C++11)
Ranges library (C++20)
Filesystem library (C++17)
Concurrency support library (C++11)
Execution control library (C++26)
Memory management library
Uninitialized memory algorithms
Constrained uninitialized memory algorithms
Memory resources
Uninitialized storage (until C++20)
Garbage collector support (until C++23)
(exposition only*)
(C++11)
(C++23)
(C++11)
(C++17)
(C++11)
(C++11)
(C++20)
(C++20)
(C++17)
(C++11)
(C++17)
(C++20)
(C++17)
(C++17)
(C++17)
(C++17)
(C++17)
(C++17)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++17)
(C++17)
(C++17)
(C++17)
(C++17)
(C++17)
(C++17)
(C++17)
(until C++20*)
(until C++20*)
(until C++20*)
(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)
(C++11)
(C++11)
(C++17)
(C++20)
(C++17)
(C++11)
(C++11)
(C++11)
(until C++17*)
(C++11)
owner_less<void>
(C++17)
(C++26)
(C++26)
(C++11)
(C++11)
(C++11)
(C++23)
(C++23)
(C++11)
(C++20)
(C++11)
(C++11)
(C++20)
(C++26)
Defined in header
<memory>
template<>
struct owner_less<void>;
(since C++17)
struct owner_less<void>;
std::owner_less <void> is a specialization of std::owner_less with parameter types deduced.
Contents
[edit] Nested types
Nested type
Definition
is_transparent
unspecified
[edit] Member functions
operator()
(function)
std::owner_less<void>::operator()
template< class T, class U >
(since C++17)
bool operator()( const std::shared_ptr <T>& lhs,
template< class T, class U >
(since C++17)
bool operator()( const std::shared_ptr <T>& lhs,
template< class T, class U >
(since C++17)
bool operator()( const std::weak_ptr <T>& lhs,
template< class T, class U >
(since C++17)
bool operator()( const std::weak_ptr <T>& lhs,
Compares lhs and rhs using owner-based semantics. Effectively calls lhs.owner_before(rhs).
The ordering is strict weak ordering relation.
lhs and rhs are equivalent only if they are both empty or share ownership.
Parameters
lhs, rhs
-
shared-ownership pointers to compare
Return value
true if lhs is less than rhs as determined by the owner-based ordering.
[edit] Notes
Feature-test macro | Value | Std | Feature |
---|---|---|---|
__cpp_lib_transparent_operators |
201510L |
(C++17) | Transparent std::owner_less (std::owner_less <void>) |
[edit] See also
provides owner-based ordering of shared pointers
(public member function of
(public member function of
std::shared_ptr<T>
) [edit]