class · System

Iterator<T>

public class System.Iterator<T> : System.Any

The values of a function with yield, made one at a time: each Next() runs the function on to its next yield. loop (T x in F()) walks them. An iterator runs once (call the function again to start over).

Tipo
class
Espacio de nombres
System
Ensamblado
System.Core
Acceso
public, abstract
Archivo fuente
Iterator.ant

Parámetros de tipo

NombreRestricciones
Tcualquier tipo

Herencia

Clases base
Any Iterator<T>

Propiedades

property Current: T
#

read-only

The value Next() moved to.

Métodos

method Next() -> bool
#

abstract

Runs on to the next value: false when the function has ended (and from then on).

method Dispose() -> void
#

Ends the iterator before its last value: the finally blocks around the yield it paused at run (as they do when it ends on its own), and Next() gives false from then on. Nothing happens to one that has ended.

method Iterator() -> System.Iterator<T>
#

Itself: loop (T x in iterator) walks what is left of it.

Campos

field current: T
#

inherited

The value the last yield gave.

field disposing: bool
#

inherited

Set by Dispose(): the next step runs the finally blocks around the last yield and ends.

Miembros heredados (5)

Código fuente

Iterator<T> en Larva HIR, descompilado a partir de su Larva HIR.

System.Iterator.hir
// The values of a function with `yield`, made one at a time: each `Next()` runs the function on to its next
// `yield`. `loop (T x in F())` walks them. An iterator runs once (call the function again to start over).
public class System.Iterator<T> : System.Any
{
    // The value the last `yield` gave.
    field current: T
    // Set by `Dispose()`: the next step runs the `finally` blocks around the last `yield` and ends.
    field disposing: bool
    // Runs on to the next value: false when the function has ended (and from then on).
    method Next() -> bool
    // Ends the iterator before its last value: the `finally` blocks around the `yield` it paused at run (as they
    // do when it ends on its own), and `Next()` gives false from then on. Nothing happens to one that has ended.
    method Dispose() -> void
    // Itself: `loop (T x in iterator)` walks what is left of it.
    method Iterator() -> System.Iterator<T>
    // The value `Next()` moved to.
    property Current: T
}
Esc