struct that preserves the range interface of input.auto handle(E : Throwable, RangePrimitive primitivesToHandle, alias handler, Range)(Range input) if (isInputRange!Range)Handle exceptions thrown from range primitives.
Use the RangePrimitive enum to specify which primitives to _handle. Multiple range primitives can be handled at once by using the OR operator or the pseudo-primitives RangePrimitive.access and RangePrimitive.pop. All handled primitives must have return types or values compatible with the user-supplied handler.
E | The type of Throwable to _handle. |
primitivesToHandle | Set of range primitives to _handle. |
handler | The callable that is called when a handled primitive throws a Throwable of type E. The handler must accept arguments of the form E, ref IRange and its return value is used as the primitive's return value whenever E is thrown. For opIndex, the handler can optionally recieve a third argument; the index that caused the exception. |
input | The range to _handle. |
struct that preserves the range interface of input.Take when sliced with a specific lower and upper
bound (see hasSlicing); handle deals with this by takeing 0 from the return value of the handler function and returning that when an exception is caught.