Mercurial > projects > ldc
diff lphobos/std/stdio.d @ 22:a6360e68134a trunk
[svn r26] * Fixed templates defining a constant value
* Fixed problem with slice-slice copy assignment if a side was a temporary slice
author | lindquist |
---|---|
date | Thu, 04 Oct 2007 07:35:02 +0200 |
parents | 8d45266bbabe |
children | 77e3d1ddae3f |
line wrap: on
line diff
--- a/lphobos/std/stdio.d Thu Oct 04 07:01:15 2007 +0200 +++ b/lphobos/std/stdio.d Thu Oct 04 07:35:02 2007 +0200 @@ -1,13 +1,15 @@ module std.stdio; +import std.traits; + void _writef(T)(T t) { static if(is(T: Object)) _writef(t.toString()); else - static if(is(T==char)) _writef("%c", t); else + static if(is(T==char)) printf("%c", t); else static if(is(T: char[])) printf("%.*s", t.length, t.ptr); else static if(isArray!(T)) { _writef('['); if (t.length) _writef(t[0]); - for (int i=1; i<elem.length; ++i) { _writef(','); _writef(t[i]); } + for (int i=1; i<t.lengthi; ++i) { _writef(','); _writef(t[i]); } _writef(']'); } else static if(is(T==int)) printf("%i", t); else