Voting: std.logger

Sönke Ludwig via Digitalmars-d digitalmars-d at puremagic.com
Wed Sep 10 11:18:54 PDT 2014


Am 10.09.2014 17:41, schrieb Timon Gehr:
> On 09/10/2014 03:22 PM, Daniel Murphy wrote:
>> "Jacob Carlborg"  wrote in message news:lupda8$nl1$1 at digitalmars.com...
>>> Could we modify the compiler to allow that? Just for the special
>>> identifiers __LINE__, __FILE__ and similar. It wouldn't be possible to
>>> specify a value for that parameter then.
>>
>> IIRC Andrei has a bugzilla open for this.
>
> Why? I cannot remember a compiler version where the following did not work:
>
> import std.stdio;
> void fun(A...)(A args, int l = __LINE__){ writeln(args," ",l); }
> void main(){ fun(1,2,3); }
>
> I.e. there is absolutely no issue here.

Except that it unfortunately doesn't do what is intended:

import std.stdio;
void fun(A...)(A args, int l = __LINE__){ writeln(args," ",l); }
void main(){ fun(10,11); }

output:
10 11

expected:
1011 3


More information about the Digitalmars-d mailing list