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

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Sep 27 22:58:47 UTC 2021


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

Ate Eskola <Ajieskola at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |Ajieskola at gmail.com

--- Comment #1 from Ate Eskola <Ajieskola at gmail.com> ---
I have looked at this, and I'm afraid there is not much to do without a
redesign. The root problem is that `InputRange` interface has the `moveFront`
member, so ranges with postblitting rvalue elements simply do not satisfy the
InputRange interface.

This module is so old and stable that moving `moveFront` to
`InputRangeAssignable` is too disruptive IMO. I see three reasonable courses of
action:

1. Leave be as is, just document the behaviour.
2. Allow `moveFront` (here, but not at `std.range.primitives`) to call the
postblit or copy constructor if it's the only way to access the front element.
3. Option 1 for now, but a redesign when the Phobos V2 versioning scheme is
out.

I think this warrants discussion. I'm going to start a forum thread tomorrow.

--


More information about the Digitalmars-d-bugs mailing list