protocol for using InputRanges

monarch_dodra monarchdodra at gmail.com
Sat Mar 29 01:51:18 PDT 2014


On Saturday, 29 March 2014 at 00:14:40 UTC, Andrei Alexandrescu 
wrote:
> It increasingly seems to me we need to do this. -- Andrei

What I find funny here is that walter is saying we must enforce 
that empty always be called in the range - "for performance".

Yet about a year ago, he made a proposal for a 
"SentinelInputRange", where you could do away with empty 
altogether because "tl,dr: PERFORMANCE!".

http://forum.dlang.org/thread/kgmatj$1v8b$1@digitalmars.com

If you need to deviate from the rules for extra performance, then 
fine. Just document that it is a lower level range, with useage 
limitations.

However, making a global design change because *1* type of range 
needs it, "for performance", I'm not fine with.


More information about the Digitalmars-d mailing list