mapBounds<D extends Comparable<D>> method

  1. @override
RangeUntil<D> mapBounds<D extends Comparable<D>>(
  1. D mapper(
    1. C
    )
)
override

Returns this with every bound value mapped using mapper.

mapper must be monotonically increasing, i.e., preserve the order of values. Otherwise, the resulting bounds end up swapped.

This is not called map/cast because IntRange & co. also implement Iterable, where those names mean converting the elements rather than the bounds.

Implementation

@override
RangeUntil<D> mapBounds<D extends Comparable<D>>(D Function(C) mapper) =>
    RangeUntil(mapper(end));