Specify variable type for range of associative arrays.

Christopher Davies via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Aug 9 10:41:38 PDT 2015


On Sunday, 9 August 2015 at 14:35:23 UTC, Marc Schütz wrote:
> You can use InputRange:
> http://dlang.org/phobos/std_range_interfaces.html#InputRange
>
> e.g.
>
>     auto input = yourOriginalData.map!someTransformation;
>     InputRange!string range;
>     if(where != "")
>         range = inputRangeObject(input.filter!(s => s == 
> where));
>     else
>         range = inputRange(input);

This is exactly it. Thank you!


More information about the Digitalmars-d-learn mailing list