Error: constant false is not an lvalue

Steven Schveighoffer schveiguy at yahoo.com
Mon Aug 31 11:55:43 PDT 2009


On Mon, 31 Aug 2009 13:00:34 -0400, Manfred_Nowak <svv1999 at hotmail.com>  
wrote:

> Steven Schveighoffer wrote:
>
>> What is i referencing when you call:
>>   foo();
>
> Is this an argument for making
>
>   int j;
>   void foo(ref int i = &j);
>   foo():
>
> legal D?
>

No, I'm just trying to explain why having a default value for a ref arg  
that is a manifest constant makes no sense.

It's possible that something like what you wrote could work (although I'd  
write it foo(ref int i = j)).

-Steve


More information about the Digitalmars-d-learn mailing list