∙ iterator-type is a type name.
Iterators are identifiers that expand to multiple values in the clause on which they appear.
The syntax of the iterator modifier is as follows:
iterator(iterators-definition)
where iterators-definition is one of the following:
iterator-specifier [, iterators-definition ]
where iterator-specifier is one of the following:
[ iterator-type ] identifier = range-specification
where:
∙ iterator-type is a type name.
∙ iterator-type is a type specifier.
In an iterator-specifier, if the iterator-type is not specified then the type of that iterator is of int type.
In an iterator-specifier, if the iterator-type is not specified then the type of that iterator is default integer.
In a range-specification, if the step is not specified its value is implicitly defined to be 1.
An iterator only exists in the context of the clause in which it appears. An iterator also hides all accessible symbols with the same name in the context of the clause.
The use of a variable in an expression that appears in the range-specification causes an implicit reference to the variable in all enclosing constructs.
The values of the iterator are the set of values i0, …, iN-1 where:
The values of the iterator are the set of values i1, …, iN where:
The set of values will be empty if no possible value complies with the conditions above.
For those clauses that contain expressions that contain iterator identifiers, the effect is as if the list item is instantiated within the clause for each value of the iterator in the set defined above, substituting each occurrence of the iterator identifier in the expression with the iterator value. If the set of values of the iterator is empty then the effect is as if the clause was not specified.
The behavior is unspecified if ij + step cannot be represented in iterator-type in any of the ij + step computations for any 0 ≤ j < N in C/C++ or 0 < j ≤ N in Fortran.
∙ The iterator-type must be an integral or pointer type. ∙ The iterator-type must not be const qualified.
∙ The iterator-type must be an integer type.