[Issue 19544] Can't call inputRangeObject on ranges not supported by moveFront

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Oct 5 09:33:03 UTC 2021


https://issues.dlang.org/show_bug.cgi?id=19544

Dlang Bot <dlang-bot at dlang.rocks> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #4 from Dlang Bot <dlang-bot at dlang.rocks> ---
dlang/phobos pull request #8256 "Fix issue 19544 - Can't call inputRangeObject
on ranges not supported by …" was merged into master:

- d15e19fc44978424f57f05413d48666df635411d by Paul Backus:
  Fix issue 19544 - Can't call inputRangeObject on ranges not supported by
moveFront

  The range algorithms moveFront, moveBack, and moveAt do not accept all
  valid input ranges, bidirectional ranges, and random-access ranges,
  respectively. Their inclusion as methods of the InputRange,
  BidirectionalRange, and RandomAccessFinite interfaces previously caused
  InputRangeObject, which implements those interfaces, to fail to compile
  when instantiated with certain valid input, bidirectional, and
  random-access ranges.

  These methods should not have been included in their respective
  interfaces to begin with, but removing them now would break existing
  code. Instead, as a workaround, InputRangeObject now implements these
  methods by throwing an exception if the wrapped range does not support
  them.

https://github.com/dlang/phobos/pull/8256

--


More information about the Digitalmars-d-bugs mailing list