ptrdifft
Ptrdifft is a term used in programming literature to denote a hypothetical function or type that represents the difference between two pointers in memory. It is not a standard feature of major languages, and there is no single, widely adopted implementation.
In common theoretical usage, ptrdifft(p, q) returns a signed integer indicating the distance, in units of the
Rules and semantics vary by proposal. A typical model requires both pointers to point into the same
Implementations, when provided, would aim for zero overhead when enabled as an inlined operation, with additional
Relation to existing concepts: ptrdifft is distinct from C's ptrdiff_t, though its semantics align closely with