Repeat

Create a range which repeats one value.

Members

Functions

opIndex
inout(T) opIndex(size_t )
opSlice
auto opSlice(size_t i, size_t j)
auto opSlice(size_t , DollarToken )
popBack
void popBack()
popFront
void popFront()
opDollar
enum opDollar;
back
inout(T) back [@property getter]

Range primitives

Manifest constants

Properties

front
inout(T) front [@property getter]
save
auto save [@property getter]
empty
enum bool empty;

Range primitives

Variables

Return Value

If n is not defined, an infinite random access range with slicing.

If n is defined, a random access range with slicing.

Examples

import std.algorithm.comparison : equal;

assert(5.repeat().take(4).equal([5, 5, 5, 5]));
import std.algorithm.comparison : equal;

assert(5.repeat(4).equal([5, 5, 5, 5]));

Meta