You mean something like this ? struct fruits { Banana banana(); Apple apple(); }
I now use foreach(int i, Fruit fruit; fruits) a lot. How do I iterate over all elements when I use the above? > Saaa Wrote: > >> >> this wrong: >> >> fruits[BANANA].peel(); >> > >> > why not using struct? >> >> How do you mean? >> What should be a struct? >> > typed array.