Get rid of isInfinite()?

Mehrdad wfunction at hotmail.com
Mon Jun 25 10:43:00 PDT 2012


On Monday, 25 June 2012 at 17:38:55 UTC, Steven Schveighoffer 
wrote:
>
> I think you misunderstand an infinite range.  There are plenty 
> of truly infinite ranges available.
>
> An example infinite range:
>
> struct Infinite
> {
>    int x;
>    @property int front() { return x;}
>    void popFront() {}
>    enum empty = false;
> }
>
> length has nothing to do with infinite ranges.  In fact, 
> infinite ranges should have no length member.
>
> -Steve

Oh, I see. So they're truly infinite, not just unbounded.

In that case, how do you make a random-access wrapper around an 
input range?
(i.e. What do you use for 'length'?)


More information about the Digitalmars-d mailing list