shadow:standard

Interface CanIterate<T>

interface CanIterate<T>

Interface CanIterate<T> specifies that a class can produce an Iterator<T> which can iterate over objects of type T. This interface allows an object of the class to be the target of a foreach loop or any other context where iteration over values is required. It is expected that most container classes will implement this interface. This interface differs from CanIterateNullable<T> in that it produces an Iterator<T>, whose iterated values are guaranteed never to be null.

See Also

Method Summary

Modifiers Return Types Method and Description
public readonly (Iterator<T>) iterator()

Method to produce a new iterator, presumably to the first item in a collection, if items are ordered.

Method Detail

iterator

public readonly iterator() => (Iterator<T>)

Method to produce a new iterator, presumably to the first item in a collection, if items are ordered.

Returns

iterator to objects of type T