times

Execute Expression action the same way n times.

void
times
(
alias action
N
)
(
N n
)
if (
isCallable!action &&
isIntegral!N
&&
arity!action <= 1
)

Examples

enum n = 10;
int sum = 0;
10.times!({ sum++; });
assert(sum == n);

Meta