IIterator<T>.MoveNext Method

Definition

Advances the iterator to the next item in the collection.

public:
 bool MoveNext();
bool MoveNext();
public bool MoveNext();
Public Function MoveNext () As Boolean

Returns

Boolean

bool

True if the iterator refers to a valid item in the collection; false if the iterator passes the end of the collection.

Remarks

If the iterator is already past the end of the collection, the iterator may throw an exception.

.NET Framework If the iterator is already past the end of the collection, the iterator may throw a COMException exception with an HResult of 0x8000000B (E_BOUNDS).

C++/WinRT If the iterator is already past the end of the collection, the iterator may throw a hresult_out_of_bounds exception.

C++/CX If the iterator is already past the end of the collection, the iterator may throw a OutOfBoundsException exception.

If the underlying collection has changed, the iterator may throw an exception.

.NET Framework If the underlying collection has changed, the iterator may throw a COMException exception with an HResult of 0x8000000C (E_CHANGED_STATE).

C++/WinRT If the underlying collection has changed, the iterator may throw a hresult_changed_state exception.

C++/CX If the underlying collection has changed, the iterator may throw a ChangedStateException exception.

Applies to

See also