On 12/20/2011 07:13 PM, bearophile wrote:
Michal Minich:

struct Group (Items ...)
{
     // how to do this? ... no static foreach :(
     static foreach (I; Items)

In D if you use foreach on a typeTuple you get a static foreach.

Bye,
bearophile

Yes, but foreach cannot be used in declaration scope. I think having static foreach would greatly benefit the language. I regularly run into cases where I have to use one of the two inferior solutions when static foreach would be just the right tool for the job.

Reply via email to