std.v2020.algorithm etc[ WAS: Is run.d going to be expand for runtime and the phobos library?]

Stanislav Blinov stanislav.blinov at gmail.com
Sat Jun 27 17:30:54 UTC 2020


On Saturday, 27 June 2020 at 17:16:10 UTC, Paul Backus wrote:

>> An immutable or const input range just cannot be. An input 
>> range can't not be mutable.
>> If a range itself can implement a `tail()`, it's not an input 
>> range, it's a forward range.
>
> This is false.
>
> While it is true that a pure input range cannot exist without 
> the presence of mutable state *somewhere*, it does not follow 
> that the mutable state must be stored in (or pointed to by) the 
> range itself. Consider the following example:
>
>     auto fdByChar(int fd)
> ...
> Of course, there is mutable state involved here, but that state 
> is not in the range--it's in the kernel. So the `immutable` 
> qualifier on the range does not apply to it.

Thereby result of (input.tail == input.tail) is a coin flip? I 
don't think that's a sensible design.


More information about the Digitalmars-d mailing list