Share via


EmptyEnumerator Class

Definition

Acts as a placeholder when enumeration is called on an empty collection. 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

Remarks

The empty enumerator is returned by the runtime when there are no elements in the collection to enumerate over.

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. The EmptyEnumerator always returns false for this method.

Reset()

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

Applies to