www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Suggestion: foreach for tuples should be renamed static foreach

reply nazo <lovesyao gmail.com> writes:
foreach for tuple expand in compile time. So I think that foreach for 
tuples should be renamed static foreach.
#Sorry for my poor English

now:
foreach(i,T;TL){
   static if(i>1){

   }
}

suggestion:
static foreach(i,T;TL){
   static if(i>1){

   }
}
Dec 04 2006
parent Lionello Lunesu <lio lunesu.remove.com> writes:
nazo wrote:
 foreach for tuple expand in compile time. So I think that foreach for 
 tuples should be renamed static foreach.
 #Sorry for my poor English
 
 now:
 foreach(i,T;TL){
   static if(i>1){
 
   }
 }
 
 suggestion:
 static foreach(i,T;TL){
   static if(i>1){
 
   }
 }

I've suggested the same thing and still think "static" should be needed there. L.
Dec 04 2006