You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 1, 2021. It is now read-only.
Tolik Pylypchuk edited this page May 28, 2018
·
6 revisions
Empty collections
Empty Enumerable
An EmptyEnumerable<T> is an enumerable which doesn't contain any elements. This class has no state and is implemented as a singleton. The single instance can be accessed via the Instance property.
The GetEnumerator method returns an EmptyEnumerator<T>.
An empty enumerator of type T is represented by the class EmptyEnumerator<T>. This class has no state and is implemented as a singleton. The single instance can be accessed via the Instance property.
MoveNext() does nothing and always returns false. Reset() and Dispose() also do nothing.
Current throws an InvalidOperationException. This property should never be called as per the specification of enumerators (because MoveNext() returns false).