Mercurial > projects > ldc
diff tests/mini/foreach9.d @ 468:45a67b6f1310
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.
author | Tomas Lindquist Olsen <tomas.l.olsen@gmail.com> |
---|---|
date | Mon, 04 Aug 2008 02:59:34 +0200 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/mini/foreach9.d Mon Aug 04 02:59:34 2008 +0200 @@ -0,0 +1,24 @@ +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() { }