A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://en.cppreference.com/w/cpp/language/../error/error_code/../../../cpp/memory/owner_equal.html below:

std::owner_equal - cppreference.com

struct owner_equal;

(since C++26)

This function object provides owner-based (as opposed to value-based) mixed-type equal comparison of both std::weak_ptr and std::shared_ptr. The comparison is such that two smart pointers compare equivalent only if they are both empty or if they share ownership, even if the values of the raw pointers obtained by get() are different (e.g. because they point at different subobjects within the same object).

3) std::owner_equal deduces the parameter types from the arguments.

[edit] Nested types [edit] Member functions compares its arguments using owner-based semantics
(function) std::owner_equal::operator()

Compares lhs and rhs using owner-based semantics. Effectively calls lhs.owner_equal(rhs).

The equal comparison is an equivalence 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 and rhs are both empty or share ownership as determined by the owner-based equal comparison, false otherwise.

[edit] Notes [edit] See also provides owner-based equal comparison of shared pointers
(public member function of std::shared_ptr<T>) [edit] provides owner-based equal comparison of weak pointers
(public member function of std::weak_ptr<T>) [edit]

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4