AsyncEnumerator
AsyncEnumerator copied to clipboard
Defining an empty enumerator is broken
Defining an empty enumerator
private static async AsyncEnumerator<int> GetEmptyEnumerator()
{
var yield = await AsyncEnumerator<int>.Capture();
return yield.Break();
}
yields the enumerators MoveNext
method to return true
on the first access while the Current
property contains the default value of the type iterated (null for reference types).