cptr::operator-

Subtraction operators

Synopses

Declared in <cptr/ptr.hpp>

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

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

Subtraction operator

constexpr
basic_ptr
operator-(
    basic_ptr p,
    std::ptrdiff_t n) noexcept
requires (!std::is_void_v<T>);
» more...

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

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;
» more...

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

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-(
    U* a,
    basic_ptr b) noexcept;
» more...