dmd 2.029 release
Denis Koroskin
2korden at gmail.com
Mon Apr 20 04:27:04 PDT 2009
On Mon, 20 Apr 2009 14:58:38 +0400, tama <repeatedly at gmail.com> wrote:
> bearophile wrote:
>> tama:
>>> void foo(alias f)()
>>> {
>>> writefln(f(3, 4));
>>> }
>>> foo!((x,y){ return x * y; })();
>>>
>>> This code doesn't work(compile error).
>>
>> To me the following works:
>>
>> import std.stdio: writeln;
>> void foo(alias f)() {
>> writeln(f(3, 4));
>> }
>> void main() {
>> foo!((x,y){ return x * y; })();
>> }
> I see.
>
> I tested following code.
>
> writefln(3 * 4);
>
> This code doesn't work in the first place:-<
> Sorry, it didn't matter.
>
writefln now expects a string as a first argument.
Use writeln() if you need no formattings, it is both faster and safer.
More information about the Digitalmars-d-announce
mailing list