Literan/constant ranges

Meta via Digitalmars-d digitalmars-d at puremagic.com
Sat Apr 25 22:05:54 PDT 2015


On Sunday, 26 April 2015 at 04:59:48 UTC, Manu wrote:
> I find myself using these a lot. I hacked them together because 
> I
> couldn't find anything equally simple in the std library:
>
> https://gist.github.com/TurkeyMan/1f551bc5a0d2cec8af2e
>
> The question is, is there already a proper/better way to do 
> this?

LiteralRange looks quite similar to std.range.repeat[1], and 
ConstantRange looks similar to std.range.only[2].

1: http://dlang.org/phobos/std_range.html#repeat
2: http://dlang.org/phobos/std_range.html#only


More information about the Digitalmars-d mailing list