operator - method - Uint16Pointer extension - dart:ffi library (original) (raw)

  1. @Since('3.3')

Pointer<Uint16> operator -(

  1. int offset )

A pointer to the offsetth Uint16 before this one.

Equivalent to this + (-offset).

Returns a pointer to the Uint16 whose address isoffset times the size of Uint16 before the address of this pointer. That is, (this - offset).address == this.address - offset * sizeOf<Uint16>().

Also, (this - offset).value is equivalent to this[-offset], and similarly for setting,

Implementation

@Since('3.3')
@pragma("vm:prefer-inline")
Pointer<Uint16> operator -(int offset) =>
    Pointer.fromAddress(address - sizeOf<Uint16>() * offset);