var.opDollar

size_t opDollar() @property const @safe

Support `$` in slice expressions for arrays.

Returns the length of the array, enabling syntax like v[1 .. $] or v[$ - 2 .. $].

Preconditions:

  • The current value must be Type.ARRAY or Type.NULL.

Returns

The number of elements in the array, or 0 for Type.NULL.