RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
IEnumerator Interface

IEnumerator is the generic interface for container enumerators.

Pascal
IEnumerator<T> = interface(IEnumerator);
C++
template <T>
__interface IEnumerator : public IEnumerator;

Implement the IEnumerator interface in the class that has to act as an enumerator for a container. An IEnumerator is usually obtained by a call to the container's GetEnumerator method.  

Classes that implement the IEnumerator interface are considered enumerators in Delphi language and are used automatically by the for..in statement.

Note: It is not required that IEnumerator be actually implemented by a class in order to be considered an enumerator. It is enough to simply implement the required methods in your class. Still, we recommend that you implement the IEnumerator interface.
 

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!