Function ScratchBuffer.opIndex

Returns a mutable reference to one live element.

ref T opIndex(
  size_t index
) scope;

ref const(T) opIndex(
  size_t index
) scope const;

Parameters

NameDescription
index zero-based index in the live prefix

Returns

Borrowed reference to the selected element.

Preconditions

index < length.

Invalidation

Successful capacity growth, whole-buffer move, or destruction invalidates the reference.