Re: Infinite BidirectionalRange?

2010-12-26 Thread spir
On Sun, 26 Dec 2010 00:36:26 + (UTC) Tomek Sowiński j...@ask.me wrote: proposed A random-access range is a bidirectional range OR an infinite forward range that offers the primitive opIndex. /proposed I can't be sure whether the former should also provide the primitive

Re: Infinite BidirectionalRange?

2010-12-25 Thread Tomek Sowiński
be an infinite BidirectionalRange. Since a BidirectionalRange defines both front() and back(), its being infinite can only come from asymptoting at one or more points in between the two ends. Is that useful? Does the document need correction or my understanding? :) I think the docs silently

Re: Infinite BidirectionalRange?

2010-12-25 Thread Simen kjaeraas
Ali Çehreli acehr...@yahoo.com wrote: Since a BidirectionalRange defines both front() and back(), its being infinite can only come from asymptoting at one or more points in between the two ends. Is that useful? Consider Cycle[1]. cycle([1,2]) may very well be a bidirectional range, but it

Re: Infinite BidirectionalRange?

2010-12-25 Thread Andrei Alexandrescu
or infinite auto e = r[1]; // can index /quote The part that starts with In either case does not make sense to me (and the sample code does not cover all possible cases). It seems to suggest that a RandomAccessRange may be an infinite BidirectionalRange. Since a BidirectionalRange defines both

Re: Infinite BidirectionalRange?

2010-12-25 Thread Ali Çehreli
) || isInfinite!(R)); // range is bidirectional or infinite auto e = r[1]; // can index /quote The part that starts with In either case does not make sense to me (and the sample code does not cover all possible cases). It seems to suggest that a RandomAccessRange may be an infinite BidirectionalRange

Re: Infinite BidirectionalRange?

2010-12-25 Thread Tomek Sowiński
to suggest that a RandomAccessRange may be an infinite BidirectionalRange. Since a BidirectionalRange defines both front() and back(), its being infinite can only come from asymptoting at one or more points in between the two ends. Is that useful? Does the document need correction

Infinite BidirectionalRange?

2010-12-24 Thread Ali Çehreli
or infinite auto e = r[1];// can index /quote The part that starts with In either case does not make sense to me (and the sample code does not cover all possible cases). It seems to suggest that a RandomAccessRange may be an infinite BidirectionalRange. Since