February 10, 2015
On 2/10/2015 2:45 PM, Walter Bright wrote:
> unittest
> {
>      string s = "hello";
>      auto r = InputRange!string(s);
>      r.testInputRange(10);

    import std.range;
    assert(isInputRange!(typeof(r)));

> }


Forgot to add that. Exactly why this needs to be in a standard module!

February 11, 2015
On 09/02/15 02:41, Walter Bright via Digitalmars-d wrote:
> I propose a std.test.ranges package, which contains templates defining each of
> the range types (InputRange, BiDirectionalRange, etc.). Each accepts an argument
> which is a static array of T, and then implements exactly the range interface
> indicated by its name, nothing more.

Why only a template static array?  Why not allow for an an array wrapper?
February 11, 2015
On 2/10/2015 7:03 PM, Joseph Rushton Wakeling via Digitalmars-d wrote:
> Why only a template static array?  Why not allow for an an array wrapper?

Good point. See my followup.
February 11, 2015
On 2/8/2015 5:41 PM, Walter Bright wrote:
> I propose a std.test.ranges package, which contains templates defining each of
> the range types (InputRange, BiDirectionalRange, etc.). Each accepts an argument
> which is a static array of T, and then implements exactly the range interface
> indicated by its name, nothing more. The range will also have asserts to
> guarantee they are used correctly, i.e. front() cannot be called before empty()
> returns false.

Here's another stab at it:

http://digitalmars.com/sargon/asinputrange.html
February 11, 2015
On 2015-02-11 at 11:58, Walter Bright wrote:
> Here's another stab at it:
> http://digitalmars.com/sargon/asinputrange.html

I see four lights, err... spaces. There are four spaces. :)
1 2 3
Next ›   Last »