value · System
LinkedListIterator<T>
public value LinkedListIterator<T>
The values of a linked list, from the first.
- Kind
- value
- Namespace
- System
- Assembly
- System.Core
- Access
- public
- Source file
LinkedList.ant
Type parameters
| Name | Constraints |
|---|---|
T | any type |
Constructors
new(LinkedListNode<T>? first)
#
Properties
T Current { get; }
#
Methods
Private and internal members (2)
LinkedListNode<T>? next
#
LinkedListNode<T>? current
#
Source
LinkedListIterator<T> as Antril, decompiled from its Larva HIR.
// System.LinkedListIterator — System.Core (decompiled from Larva HIR)
into namespace System
{
/// The values of a linked list, from the first.
public value LinkedListIterator<T>
{
LinkedListNode<T>? next;
LinkedListNode<T>? current;
public:
new(LinkedListNode<T>? first)
{
next = first;
}
Next() : bool
{
if (next is not LinkedListNode<T> node)
return false;
current = node;
next = node.Next;
return true;
}
T Current
{
get
{
if (current is LinkedListNode<T> node)
return node.Value;
throw new InvalidOperationError("the iterator is not on a value");
}
}
}
}