Function ensureDecodeable

Wraps a text-based iopipe to make sure all code units are decodeable.

auto auto ensureDecodeable(Chain) (
  Chain c
if (isIopipe!Chain && isSomeChar!(ElementEncodingType!(WindowType!Chain)));

When an iopipe is made up of character types, in some cases a slice of the window may not be completely decodeable. For example, a wchar iopipe may have only one half of a surrogate pair at the end of the window.

This function generates an iopipe that only allows completely decodeable sequences to be released to the next iopipe.


c The iopipe whose element type is one of char, wchar, or dchar.


An appropriate iopipe that ensures decodeability. Note that dchar iopipes are always decodeable, so the result is simply a return of the input.