CSharpUtilities::Enumerable< T > Class Template Reference


Detailed Description

template<T>
class CSharpUtilities::Enumerable< T >

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&lt;object&gt;(myCustomEnumerator))...
Template Parameters:
T Type over which the Enumerator enumerates.

List of all members.

Public Member Functions

  Enumerable (IEnumerator< T > enumerator)
  Constructor taking the target enumerator.
IEnumerator< T >  GetEnumerator ()
  Get the encapsulated enumerator.

Member Function Documentation

template<T >
CSharpUtilities::Enumerable< T >::Enumerable ( IEnumerator< T >  enumerator ) [inline]

Constructor taking the target enumerator.

Parameters:
enumerator The enumerator to use for enumeration.
template<T >
IEnumerator<T> CSharpUtilities::Enumerable< T >::GetEnumerator ( ) [inline]

Get the encapsulated enumerator.

Returns:
The encapsulated enumerator.