If n is not defined, an infinite random access range with slicing.
If n is defined, a random access range with slicing.
import std.algorithm.comparison : equal; assert(5.repeat(4).equal([5, 5, 5, 5]));
import std.algorithm.comparison : equal; assert(5.repeat().take(4).equal([5, 5, 5, 5]));
Create a range which repeats one value.