Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

ImmutableSortedSet<T>::GetEnumerator Method ()

 

Returns an enumerator that iterates through the immutable sorted set.

Namespace:   System.Collections.Immutable
Assembly:  System.Collections.Immutable (in System.Collections.Immutable.dll)

public:
virtual ImmutableSortedSet<T>::Enumerator GetEnumerator() sealed

Return Value

Type: System.Collections.Immutable::ImmutableSortedSet<T>::Enumerator

An enumerator that can be used to iterate through the set.

System_CAPS_cautionCaution

When you use this enumerator as a value type (that is, when it isn't boxed), do not copy it by assigning it to a second variable or by passing it to another method. When this enumerator is disposed of, it returns a mutable reference type stack to a resource pool, and if the value type enumerator is copied (which can easily happen unintentionally if you pass the value around), there is a risk that a stack that has already been returned to the resource pool may still be in use by one of the enumerator copies, leading to data corruption and exceptions.

NuGet package: System.Collections.Immutable (about immutable collections and how to install)

Return to top
Show:
© 2017 Microsoft