>From TDPL, page 161:
import std.conv;
void writeln(T...)(T args)
{
foreach (arg; args)
{
stdout.rawWrite(to!string(arg));
}
stdout.rawWrite('\n');
stdout.flush();
}
void main()
{
writeln("test");
}
test.d(10): Error: undefined identifier stdout
On Wednesday, August 04, 2010 11:38:28 Andrej Mitrovic wrote:
> From TDPL, page 161:
>
> import std.conv;
>
> void writeln(T...)(T args)
> {
> foreach (arg; args)
> {
> stdout.rawWrite(to!string(arg));
> }
> stdout.rawWrite('\n');
> stdout.flush();
> }
>
> void main()
Okay, this works:
import std.conv, std.stdio;
void writeln(T...)(T args)
{
foreach (arg; args)
{
stdout.rawWrite(to!string(arg));
}
stdout.rawWrite("\n");
stdout.flush();
}
void main()
{
writeln("test");
}
But I had to replace '\n' with "\n", otherwise I get some