writeln, format, Tuple(T).toString and so on cannot take delegate(in trunk r2116).
This code should compile:
----
import std.stdio;
void main()
{
writeln({});
}
----
This bug occurred recently.
On dmd 2.042, this bug doesn't occur.
http://ideone.com/iXHoB
Comment #1 by andrei — 2011-01-04T09:43:05Z
I wonder if printing the type of the delegate is the smartest thing to do. After all one can always print typeid(...) if that's what's needed.
Comment #2 by zan77137 — 2011-01-05T07:00:52Z
(In reply to comment #1)
> I wonder if printing the type of the delegate is the smartest thing to do.
> After all one can always print typeid(...) if that's what's needed.
I think so, too.
However, there is a problem in Tuple.
Because Tuple struct was not able to receive delegate for toString function, I made it printable as first aid.
As well as Tuple, a problem may occur. Range, container, assert message...
It may be that you had better offer the default print method to support the generic programming.