Downgrading ranges

Jonathan M Davis jmdavisProg at gmx.com
Sun Jun 9 15:42:14 PDT 2013


On Sunday, June 09, 2013 14:25:44 Peter Alexander wrote:
> On Sunday, 9 June 2013 at 12:19:47 UTC, Lars T. Kyllingstad wrote:
> > A recent pull request discussion got me thinking:  The ability
> > to "downgrade" a range to a less featureful one -- wrapping a
> > random access range in an input range, say -- can be very
> > useful sometimes, particularly for testing.
> 
> "Particularly for testing", or *only* for testing? Is there any
> other use? (I can't think of any non-contrived use case beyond
> testing).
> 
> If it's just for testing, would it not be better to just supply a
> variety of test ranges that implement all combinations of traits?

I was working on a good solution for this which would allow you to create a 
test range with pretty much any combination of range capabilities you wanted 
(as well as providing a default set of ranges to test with), but some compiler 
bugs were blocking me at the time, and I haven't gotten back to it yet. I 
really should finish that up.

- Jonathan M Davis


More information about the Digitalmars-d mailing list