Documentation Home >> Headers >> <jss/experimental_atomic.hpp> Header >> std::experimental::shared_ptr >> std::experimental::shared_ptr::owner_before member function

The owner_before member function defines a strict weak ordering across std::experimental::shared_ptr and std::experimental::weak_ptr instances.

template<typename Other>
bool owner_before(shared_ptr<Other> const&) const noexcept;
template<typename Other>
bool owner_before(weak_ptr<Other> const&) const noexcept;

Returns:

A value such that a.owner_before(b)==b.owner_before(a) is true if and only if a and b share ownership, in which case a.owner_before(b)==false. The results are transitive, so they form a strict weak ordering. a.owner_before(b) and b.owner_before(c) implies a.owner_before(c).

Throws:

Nothing

Header

#include <experimental/atomic>

See Also