Francesco Cattoglio:
I agree. After relaxing the range, we can prefer a specialized
version over the iota(begin, end, 1) version. The latter should
be used as a backup instead for cases where ++ is not
implemented.
One possible disadvantage is when you want an array of various
iota (all of the same indexed type, like int) (currently this
doesn't compile), this was a potential use case for me:
void main() {
import std.range: iota;
auto intervals = [iota(10), iota(2, 7), iota(2, 15, 2)];
}
Bye,
bearophile