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
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
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
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
) || 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
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
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