Files
ldc/tests/mini/foreach9.d
Tomas Lindquist Olsen daad516579 Removed the 'needsstorage' thing from Dsymbol. Arguments are not always given storage when applicable. This is not longer treat specially
in this regard. Code for accessing nested variables and contexts rewritten. Probably more. Fairly well tested.
2008-08-04 02:59:34 +02:00

25 lines
397 B
D

module mini.foreach9;
extern(C) int printf(char* str, ...);
struct array2d(T) {
int test() {
printf("%p\n", cast(void*) this);
foreach (x; *this) {
printf("%p\n", cast(void*) this);
}
return true;
}
int opApply(int delegate(ref int) dg) {
int x;
return dg(x), 0;
}
}
unittest {
array2d!(int) test;
test.test();
//int i = 0; i /= i;
}
void main() { }