I want to do something like this (Collection is a custom type):

Collection x = new Collection();
x.add(something);
x.add(somethingElse);

foreach(type value; x)
{
    writeln(value);
}

Collection is a class with a private array member variable which actually holds the collection data entered via the add method. What do i need to add to the Collection class to make it iterable (whilst it's actually iterating through the member array) so the foreach loop works as expected?

Reply via email to