Home   Manual   Type Index   Symbol Index   Topics Index

std::repeat

invoke a statement sequence for a specific number of times

Parameters

n

how often to invoke body

body

the statement sequence to invoke

return (optional; default value: pass)

a function to return selected variables to the caller

Description

The statement sequence body is invoked exactly n times.

n must be a numeric value. If it is less than 1 than body will not be called at all. n might also be a negative number (in which case body will not be called) or a noninteger number (in which case n will be rounded down to the next integer).

To start the next iteration of the loop a tail call to the next-function has to be performed.

To exit from the loop a tail call to the break-function has to be performed.

See also

std::loop   a simple loop
std::from_to   a loop iterating over a sequence of values

Topics

Loops

Example

repeat 10: write '*'
writeln

Output

**********