Transience of .front in input vs. forward ranges

Jonathan M Davis jmdavisProg at gmx.com
Mon Nov 5 10:42:47 PST 2012


On Monday, November 05, 2012 15:48:41 deadalnix wrote:
> HS Teoh explained it nicely.
> 
> The responsibility of using .transient or not belong to the consumer.
> Only the consumer can know if a transient range is suitable.
> 
> So you don't wrap a transient range. You wrap a non transient range,
> and, if the consumer is able to handle the transcient version, it call
> .transient on its source, that call it on its source, etc . . . up to
> the real source.
> 
> If one transformer is unable to handle transient range, the it don't
> pass .transient to its source.

You still need to wrap it in every wrapper range which could possibly support 
transience. So, this affects every single range which could possibly support 
transience.

At least with Andrei's proposal, transience is explicitly restricted to input 
ranges, which seriously reduces the problems caused by them, particularly 
since so few functions can really function with just an input range.

- Jonathan M Davis


More information about the Digitalmars-d mailing list