ensureElems

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

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

size_t
ensureElems
(
Chain
)
(
ref Chain chain
,
size_t elems = size_t.max
)

Parameters

elems size_t

The number of elements to ensure are in the window. If omitted, all elements are extended.

Return Value

Type: size_t

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

Meta