Mercurial > projects > ldc
diff lphobos/std/stdio.d @ 37:77cdca8c210f trunk
[svn r41] new'd dynamic arrays are now initialized with the element type's default initializer.
initial label/goto support.
author | lindquist |
---|---|
date | Wed, 10 Oct 2007 03:38:24 +0200 |
parents | 77e3d1ddae3f |
children | 2c3cd3596187 |
line wrap: on
line diff
--- a/lphobos/std/stdio.d Tue Oct 09 07:51:13 2007 +0200 +++ b/lphobos/std/stdio.d Wed Oct 10 03:38:24 2007 +0200 @@ -12,7 +12,8 @@ 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 @@ foreach (v; t) _writef(v); } void writefln(T...)(T t) { - writef(t, "\n"[]); + writef(t, "\n"); } +