Dummy Enumerable to serve as a wrapper around an Enumerator for easy use in a foreach loop.
Given an enumerator for performing a custom iteration, this class serves to spare the work of also creating an Enumerable just so that the enumerator can be used in a foreach loop.
This class is generally used as:
foreach(object myobject in new Enumerable<object>(myCustomEnumerator))...
T | Type over which the Enumerator enumerates. |
Public Member Functions |
|
Enumerable (IEnumerator< T > enumerator) | |
Constructor taking the target enumerator.
|
|
IEnumerator< T > | GetEnumerator () |
Get the encapsulated enumerator. |
CSharpUtilities::Enumerable< T >::Enumerable | ( | IEnumerator< T > | enumerator | ) | [inline] |
Constructor taking the target enumerator.
enumerator | The enumerator to use for enumeration. |
IEnumerator<T> CSharpUtilities::Enumerable< T >::GetEnumerator | ( | ) | [inline] |
Get the encapsulated enumerator.