value · System

SpanIterator<T>

public value SpanIterator<T>

The elements of a span, in order.

Tipo
value
Espacio de nombres
System
Ensamblado
System.Core
Acceso
public
Archivo fuente
Span.ant

Parámetros de tipo

NombreRestricciones
Tcualquier tipo

Constructores

new(Span<T> span)
#

Propiedades

T Current { get; }
#

read-only

Métodos

Next() : bool
#

Miembros privados e internos (2)

Span<T> span
#

private

i32 index
#

private

Código fuente

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

System.SpanIterator.ant
// System.SpanIterator — System.Core (decompiled from Larva HIR)

into namespace System
{
	/// The elements of a span, in order.
	public value SpanIterator<T>
	{
		Span<T> span;
		i32 index;

		public:
			new(Span<T> span)
			{
				this.span = span;
				index = -1;
			}

			Next() : bool
			{
				index++;
				return index < span.Length;
			}

			T Current
			{
				get => span[index];
			}
	}
}
Esc