Namespaces
Variants
Views
Actions

Difference between revisions of "cpp/memory/owner less void"

From cppreference.com
< cpp‎ | memory
m (Member types: either, {{c/core}} as code or nomono.)
(Wording update.)
Line 6: Line 6:
 
}}
 
}}
  
{{c/core|std::owner_less<>}} is a specialization of {{lc|std::owner_less}} with parameter types deduced.
+
{{c/core|std::owner_less<void>}} is a specialization of {{lc|std::owner_less}} with parameter types deduced.
  
===Member types===
+
===Nested types===
 
{{dsc begin}}
 
{{dsc begin}}
{{dsc hitem|Member type|Definition}}
+
{{dsc hitem|Nested type|Definition}}
{{dsc|{{tt|is_transparent}}|unspecified}}
+
{{dsc|{{tt|is_transparent}}|[[cpp/utility/functional#Transparent function objects|unspecified]]}}
 
{{dsc end}}
 
{{dsc end}}
  
 
===Notes===
 
===Notes===
{{cpp/utility/functional/is_transparent_note}}
 
 
 
{{feature test macro|__cpp_lib_transparent_operators|Transparent {{lc|std::owner_less}} ({{c/core|std::owner_less<void>}})|value=201510L|std=C++17}}
 
{{feature test macro|__cpp_lib_transparent_operators|Transparent {{lc|std::owner_less}} ({{c/core|std::owner_less<void>}})|value=201510L|std=C++17}}
  

Revision as of 21:54, 2 January 2024

 
 
Utilities library
General utilities
Relational operators (deprecated in C++20)
 
Dynamic memory management
Uninitialized memory algorithms
Constrained uninitialized memory algorithms
Allocators
Garbage collection support
(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)



 
Defined in header <memory>
template<>
struct owner_less<void>;
(since C++17)

std::owner_less<void> is a specialization of std::owner_less with parameter types deduced.

Contents

Nested types

Nested type Definition
is_transparent unspecified

Notes

Feature-test macro Value Std Feature
__cpp_lib_transparent_operators 201510L (C++17) Transparent std::owner_less (std::owner_less<void>)

Member functions

operator()
compares its arguments using owner-based semantics
(function)

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;
(since C++17)
template< class T, class U >

bool operator()( const std::shared_ptr<T>& lhs,

                 const std::weak_ptr<U>& rhs ) const noexcept;
(since C++17)
template< class T, class U >

bool operator()( const std::weak_ptr<T>& lhs,

                 const std::shared_ptr<U>& rhs ) const noexcept;
(since C++17)
template< class T, class U >

bool operator()( const std::weak_ptr<T>& lhs,

                 const std::weak_ptr<U>& rhs ) const noexcept;
(since C++17)

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.

See also

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]