20 General utilities library [utilities]

20.11 Smart pointers [smartptr]

20.11.3 Class template shared_­ptr [util.smartptr.shared]

20.11.3.7 Comparison [util.smartptr.shared.cmp]

template<class T, class U> bool operator==(const shared_ptr<T>& a, const shared_ptr<U>& b) noexcept;
Returns: a.get() == b.get().
template<class T> bool operator==(const shared_ptr<T>& a, nullptr_t) noexcept;
Returns: !a.
template<class T, class U> strong_ordering operator<=>(const shared_ptr<T>& a, const shared_ptr<U>& b) noexcept;
Returns: compare_­three_­way()(a.get(), b.get()).
Note
:
Defining a comparison function allows shared_­ptr objects to be used as keys in associative containers.
— end note
 ]
template<class T> strong_ordering operator<=>(const shared_ptr<T>& a, nullptr_t) noexcept;
Returns: compare_­three_­way()(a.get(), nullptr).