-
-
Notifications
You must be signed in to change notification settings - Fork 382
Closed
Description
If the aggregate expression is a sequence, the loop body is statically expanded once for each element. This is the same as Static Foreach on a sequence.
https://dlang.org/spec/statement.html#foreach_over_tuples
this is false, whats the actual difference, who knows, but there are differences
import std;
template Val(alias I){ enum val=I;}
void foo(T...)(){
static foreach(A;T){
static if(is(A==float)){ continue;}//error
A.stringof.writeln;
}}
void bar(T...)(){
foreach(A;T){
static if(is(A==float)){ continue;}//works
A.stringof.writeln;
}}
unittest{
foo!(int,float,bool);
bar!(int,float,bool);
}ntrel
Metadata
Metadata
Assignees
Labels
No labels