mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-03-15 00:21:50 +01:00
[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:
@@ -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");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user