Share via


EmptyEnumerator Class

Definition

Acts as a placeholder when enumeration is called on an empty collection. The runtime returns the empty enumerator when there are no elements in the collection to enumerate over. This class cannot be inherited.

public ref class EmptyEnumerator sealed : System::Collections::IEnumerator
public sealed class EmptyEnumerator : System.Collections.IEnumerator
type EmptyEnumerator = class
    interface IEnumerator
Public NotInheritable Class EmptyEnumerator
Implements IEnumerator
Inheritance
EmptyEnumerator
Implements

Constructors

EmptyEnumerator()

Initializes a new instance of the EmptyEnumerator class.

Properties

Current

Raises an error indicating an empty enumerator.

Methods

MoveNext()

Advances the enumerator to the next element of the collection. Returns false if there is no object to move to.

Reset()

Sets the enumerator to its initial position, which is before the first element in the collection.

Applies to