[svn r41] new'd dynamic arrays are now initialized with the element type's default initializer.

initial label/goto support.
This commit is contained in:
Tomas Lindquist Olsen
2007-10-10 03:38:24 +02:00
parent 4fdad2c750
commit 67a92f5d51
10 changed files with 206 additions and 113 deletions

View File

@@ -12,7 +12,8 @@ void _writef(T)(T t) {
for (int i=1; i<t.length; ++i) { _writef(','); _writef(t[i]); }
_writef(']');
} else
static if(is(T==int)) printf("%i", t); else
static if(is(T: int)) printf("%i", t); else
static if(is(T: real)) printf("%f", t); else
static assert(false, "Cannot print "~T.stringof);
}
@@ -20,5 +21,6 @@ void writef(T...)(T t) {
foreach (v; t) _writef(v);
}
void writefln(T...)(T t) {
writef(t, "\n"[]);
writef(t, "\n");
}