"Daniel Murphy" , dans le message (digitalmars.D:171720), a écrit : > Could it be extended to accept multiple values? (sort of like chain) > eg. > foreach(x; makeRange(23, 7, 1990)) // NO allocations! > { > .... > } > I would use this in a lot of places I currently jump through hoops to get a > static array without allocating.
That's a good idea. IMHO, the real solution would be to make an easy way to create static arrays, and slice them when you want a range. -- Christophe I it were just me, array litterals would be static, and people should use .dup when they want a a surviving slice. Well, if it were just me, all function signature should tell when references to data escape the scope of the function, and all data would be allocated automatically where it should by the compiler.