On 07/13/2010 06:23 AM, Steven Schveighoffer wrote:
On Mon, 12 Jul 2010 15:42:49 -0400, Andrei Alexandrescu
<seewebsiteforem...@erdani.org> wrote:


put(R, E) -> putNext(R, E)

Rationale: conveys the notion that there is progress in the output.

Can we have E getNext(R) also for completeness :) Then an input range
can be defined similarly to an output range (where delegates and ranges
that support E get() work).

Yah, see the parallel thread.

Since put/putNext already establishes the notion of throwing when full,
having getNext throwing when empty would be OK, no?

That does go against the "don't use exceptions for normal control flow" mantra, with which I agree. From a practical perspective, it makes client code unnecessarily verbose:

try
{
    for (;;) { item = getNext(r); ... }
}
catch (RangeEnd e)
{
}

Andrei

Reply via email to