cptr::operator-

The number of elements between this pointer and a raw pointer into the same array, as get() - b.

Synopsis

Declared in <cptr/ptr.hpp>

template<class U>
requires (!std::is_void_v<T> &&
             std::is_same_v<std::remove_cv_t<U>, std::remove_cv_t<T>>)
constexpr
std::ptrdiff_t
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.

Parameters

NameDescription
aThe left operand
bThe right operand