cptr::operator<=>

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

Synopsis

Declared in <cptr/ptr.hpp>

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

NOTE

This function is a hidden friend of basic_ptr, declared only inside that class: it can be found only through argument-dependent lookup.

Return Value

The relative order of the objects

Parameters

NameDescription
aThe left operand
bThe right operand