why are Assign Expressions r-values?
Daniel Keep
daniel.keep.lists at gmail.com
Sun Apr 29 17:27:49 PDT 2007
BCS wrote:
> Reply to Daniel,
>
>> BCS wrote:
>>
>>> fo(void, 1); // call fo with a temporary variable for i and a temp
>>
>> I'd be tempted to just use
>>
>> foo(0, 1);
>>
>> Since the first argument's going to be re-initialised anyway. That
>> said, having a way to specify "I don't care what goes here" would be
>> nice. The problem with using void would be functions like this:
>>
>> void ba(out int* i, inout int j);
>>
>> If you specify the first argument as void, what are you actually
>> saying?
>> Create temporary storage for the first argument, or actually pass
>> void?
>
> void has no value. Might you be thinking of null?
I could be... I could be. It's certainly a possibility. I would like
to think I know what I'm talking about, but clearly that's not true. :P
My excuse is that void *should* be a literal (equal to void.init), and
hence why I was confused. Not stupid. Nope.
-- Daniel
--
int getRandomNumber()
{
return 4; // chosen by fair dice roll.
// guaranteed to be random.
}
http://xkcd.com/
v2sw5+8Yhw5ln4+5pr6OFPma8u6+7Lw4Tm6+7l6+7D
i28a2Xs3MSr2e4/6+7t4TNSMb6HTOp5en5g6RAHCP http://hackerkey.com/
More information about the Digitalmars-d-learn
mailing list