cptr::operator<=>

Three-way comparison operators

Synopses

Declared in <cptr/ptr.hpp>

Orders a ptr and a strict_ptr to the same type by address.

template<bool S>
requires (S != Strict)
constexpr
std::strong_ordering
operator<=>(
    basic_ptr a,
    basic_ptr<T, Cage, S> const& b) noexcept;
» more...

Orders like get() <=> b through std::compare_three_way, so null orders first and unrelated pointers get a total order.

template<class U>
requires std::is_convertible_v<U*, T*>
constexpr
std::strong_ordering
operator<=>(
    basic_ptr a,
    U* b) noexcept;
» more...

All pointers share the cage base, so offsets order like addresses. Null orders first.

constexpr
std::strong_ordering
operator<=>(
    basic_ptr a,
    basic_ptr b) noexcept;
» more...

Orders like the addresses.

constexpr
std::strong_ordering
operator<=>(
    nonnull_ptr a,
    nonnull_ptr b) noexcept;
» more...