folly::Range::subpiece

Return a window into the current range, starting at first, and spanning length characters (or until the end of the current range, whichever comes first).

Synopsis

Declared in <folly/Range.h>

Range
subpiece(
    size_type first,
    size_type length = npos) const;

Description

Throws std::out_of_range if first is past the end of the current range.

Return Value

The resulting subrange.

Parameters

NameDescription
firstThe offset of the first element of the subrange.
lengthThe maximum number of elements in the subrange.