I've always used array.replicate for this. std.range.replicate seems to be scheduled for deprecation, it only aliases itself to repeat(): /// Equivalent to $(D repeat(value, n)). Scheduled for deprecation. Take!(Repeat!T) replicate(T)(T value, size_t n) { return repeat(value, n); }