|
|
Defined in header <memory> | ||
template<> struct owner_less<void>; | (since C++17) | |
std::owner_less<void> is a specialization ofstd::owner_less with parameter types deduced.
Contents |
Nested type | Definition |
is_transparent | unspecified |
operator() | compares its arguments using owner-based semantics (function) |
template<class T,class U> bool operator()(conststd::shared_ptr<T>& lhs, | (since C++17) | |
template<class T,class U> bool operator()(conststd::shared_ptr<T>& lhs, | (since C++17) | |
template<class T,class U> bool operator()(conststd::weak_ptr<T>& lhs, | (since C++17) | |
template<class T,class U> bool operator()(conststd::weak_ptr<T>& lhs, | (since C++17) | |
Compareslhs andrhs using owner-based semantics. Effectively callslhs.owner_before(rhs).
The ordering is strict weak ordering relation.
lhs andrhs are equivalent only if they are both empty or share ownership.
lhs, rhs | - | shared-ownership pointers to compare |
true iflhs isless thanrhs as determined by the owner-based ordering.
Feature-test macro | Value | Std | Feature |
---|---|---|---|
__cpp_lib_transparent_operators | 201510L | (C++17) | Transparentstd::owner_less (std::owner_less<void>) |
provides owner-based ordering of shared pointers (public member function of std::shared_ptr<T> )[edit] | |
provides owner-based ordering of weak pointers (public member function of std::weak_ptr<T> )[edit] |