cptr::operator-

The number of elements between two pointers into the same array.

Synopsis

Declared in <cptr/ptr.hpp>

constexpr
std::ptrdiff_t
operator-(
    basic_ptr a,
    basic_ptr b) noexcept
requires (!std::is_void_v<T>);

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