import std.stdio;
int main() {
uint ui;
writefln(ui);
return 0;
}
dmd error out:
$ dmd structarr.d
/home/zhou/project/dmd/linux/bin/../../src/phobos/std/stdio.d(518): Error: template std.format.formattedWrite(Writer,F,A...) does not match any function template declaration
/home/zhou/project/dmd/linux/bin/../../src/phobos/std/stdio.d(518): Error: template std.format.formattedWrite(Writer,F,A...) cannot deduce template function from argument types !()(LockingTextWriter,uint)
Comment #1 by bugzilla — 2009-05-14T20:21:12Z
writefln() expects a format string as its first argument, not a uint. To print a value without using a format string, use writeln().
Comment #2 by braddr — 2009-05-14T20:42:48Z
reopening and turning into an enhancement request. The writefln templates could do considerably better about messaging the problem.
Comment #3 by andrei — 2009-05-14T22:19:55Z
(In reply to comment #2)
> reopening and turning into an enhancement request. The writefln templates
> could do considerably better about messaging the problem.
Yah, I changed things such that now you'll see:
/home/andrei/code/dmd/phobos/std/stdio.d(512): Error: static assert "You must pass a formatting string as the first argument to writef or writefln. If no formatting is needed, you may want to use write."