how does C# "yield" translate into VB.NET?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How does the following C# code look like in VB.NET?

IEnumerator<T> IEnumerable<T>.GetEnumerator()
{
foreach (Node<T> node in this.headNode)
{
yield return node.Data;
}
}


thanks herbert
 
How does the following C# code look like in VB.NET?

There's no direct translation since VB.NET doesn's have that feature
(iterators). You have to manually implement IEnumerable and maintain
the state machine.


Mattias
 
Back
Top