[phobos] Problem with definition of isInfinite(Range)

Andrei Alexandrescu andrei at erdani.com
Mon Sep 6 18:35:13 PDT 2010


On 09/06/2010 06:42 PM, Jonathan M Davis wrote:
[snip]
> So, perhaps I'll go and refactor my code so that infinity is strictly kept to
> intervals and ranges and not time points or time durations. It would certainly
> reduce the number of runtime checks and reduce the amount of code. Of course,
> making those changes will make it take that much longer to complete the
> date/time module, but better later than poorly designed.

Infinity must be known during compilation. Otherwise RandomAccessRange 
must be a refinement of BidirectionalAccessRange, and bidirectional 
access is obviously not supported by infinite range. That closes the 
door to infinite random access ranges, of which there are many.

Andrei


More information about the phobos mailing list