GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
* Sign Up! *

Support
Customer Portal
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
std::weak_ptr::owner_equal(3) C++ Standard Libary std::weak_ptr::owner_equal(3)

std::weak_ptr::owner_equal - std::weak_ptr::owner_equal


template< class Y > (1) (since C++26)
bool owner_equal( const std::weak_ptr<Y>& other ) const noexcept;
template< class Y >
bool owner_equal( const std::shared_ptr<Y>& other ) const (2) (since C++26)
noexcept;


Checks whether this weak_ptr and other share ownership or are both empty. The
comparison is such that two smart pointers compare equivalent only if they are both
empty or if they both own the same object, even if the values of the pointers
obtained by get() are different (e.g. because they point at different subobjects
within the same object).


The member function owner_equal is an equivalence relation such that
!owner_before(other) && !other.owner_before(*this) is true if and only if
owner_equal(other) is true.


This ordering is used to make shared and weak pointers usable as keys in unordered
associative containers, typically through std::owner_equal.


other - the std::shared_ptr or std::weak_ptr to be compared


true if *this and other share ownership or are both empty. Otherwise, returns false.


Feature-test macro Value Std Feature
Enabling the use of std::weak_ptr
__cpp_lib_smart_ptr_owner_equality 202306L (C++26) as keys in unordered associative
containers


This section is incomplete
Reason: example


owner_equal provides mixed-type owner-based equal comparisons of shared and weak
(C++26) pointers
(class)


* Todo with reason

2024.06.10 http://cppreference.com

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.