Generality creep

ag0aep6g anonymous at example.com
Fri Mar 29 07:41:26 UTC 2019


On 29.03.19 02:55, Walter Bright wrote:
> Ranges don't need to be assignable. ForwardRanges need to supply a 
> save(), which means copy construction, not assignment.

Issue 18657 is all about RefRange not being assignable (without nasty 
surprises). Changing Phobos to avoid assignment of ranges will fix the 
issue.

All the mighty talk about "generality creep" and "first principles" is 
besides the point. You agree with making changes all over Phobos. You 
just don't like the weird `move` code. That's okay. I agree that fixing 
the issue with constructors is nicer.

[...]
>> How does RefRange.save need fixing?
> 
> I thought you wrote that copy construction would make RefRange work?

Implementing the `save` methods of higher ranges that way makes them 
compatible with RefRange, because they no longer call RefRange.opAssign.

RefRange.save is fine as it is (w.r.t issue 18657).


More information about the Digitalmars-d mailing list