mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-03-03 11:03:14 +01:00
[svn r37] * Initial support for foreach on static arrays. Not 100% complete
This commit is contained in:
17
test/foreach1.d
Normal file
17
test/foreach1.d
Normal file
@@ -0,0 +1,17 @@
|
||||
module foreach1;
|
||||
import std.stdio;
|
||||
|
||||
void main()
|
||||
{
|
||||
static arr = [1,2,3,4,5];
|
||||
|
||||
writef("forward");
|
||||
foreach(v;arr) {
|
||||
writef(' ',v);
|
||||
}
|
||||
writef("\nreverse");
|
||||
foreach_reverse(v;arr) {
|
||||
writef(' ',v);
|
||||
}
|
||||
writef("\n");
|
||||
}
|
||||
Reference in New Issue
Block a user