HomeManualTopicsTypesSymbols

std_types::generic_array/std::for_each

iterates over all items of the array

Parameters

self
the array to iterate over
body
the statement sequence to execute for each item
finally (default: next)
called after all items have been iterated over

Results

None

Description

For each item the statement sequence supplied as body is called with one or two arguments (depending on body's parameter count).

If called with two arguments the first argument is the position number of the item within the array.

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

The loop is exited when the end of the loop is reached without calling the next-function.

This is a sequential loop.

Implements

std::for_each iterates over all items of a collection