Transience of .front in input vs. forward ranges

deadalnix deadalnix at gmail.com
Mon Nov 5 07:50:08 PST 2012


Le 05/11/2012 08:58, Jonathan M Davis a écrit :
> On Sunday, November 04, 2012 21:07:46 H. S. Teoh wrote:
>> Stop right there. You're contradicting yourself. You kept saying that
>> transient ranges are rare, abnormal, etc., and now you say they are a
>> potentially large number of range types? I'm sorry, you've managed to
>> utterly confuse me.  Are they rare, or are they not?
>>
>> If they are rare, then this thin wrapper only needs to be written in
>> those few rare cases. *No other range type needs to be changed.*
>>
>> If they are common, then they aren't abnormal, and we should be fixing
>> Phobos to deal with them. Everywhere. In a pervasive, invasive, large
>> changeset, because almost all current code is broken w.r.t. to these
>> common cases -- if indeed they are common.
>
> Base ranges with transient fronts are rare, but as soon as you have to take
> them into account with wrapper ranges, then they potentially affect almost
> every range-based function in Phobos. So, you're taking a very rare case and
> forcing _everything_ to account for it. _That_ is why it affects a large number
> of range types.
>

Don't you understand that every other solution proposed here, including 
Andrei's, have the same very drawback ?

I'll add that this drawback is much worse, because with the ;transient 
solution, unmodified code will work correctly. With all other proposed 
behaviors, non updated code will expose undefined behavior when facing 
transient ranges, which is much worse.


More information about the Digitalmars-d mailing list