System.IEnumerable

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

IEnumerable = interface(IInterface)
IEnumerable<T> = interface(IEnumerable)

C++

__interface IEnumerable  : public IInterface
template<typename T> __interface IEnumerable__1  : public IEnumerable

Properties

Type Visibility Source Unit Parent
interface
class
public
System.pas
System.hpp
System System

Description

IEnumerable is the generic interface for enumerable containers.

To make your container enumerable, implement the IEnumerable interface. IEnumerable exposes a single method called GetEnumerator, that must return a reference to an IEnumerator interface.

Classes that implement the IEnumerable interface are considered enumerable in Delphi language and can be used in for..in statements.

Note: It is not required that IEnumerable be actually implemented by a class in order to be considered enumerable. It is enough to export a public method called GetEnumerator that returns an enumerator object. Still, we recommend that you implement the IEnumerable interface.

See Also