Function ensureElems

Extend a pipe until it has a minimum number of elements. If the minimum elements are already present, does nothing.

size_t ensureElems(Chain) (
  ref Chain chain,
  size_t elems
);

This is useful if you need a certain number of elements in the pipe before you can process any more data.

Parameters

NameDescription
chain The pipe to work on.
elems The number of elements to ensure are in the window.

Returns

The resulting number of elements in the window. This may be less than the requested elements if the pipe ran out of data.