why are Assign Expressions r-values?

BCS ao at pathlink.com
Sun Apr 29 13:43:09 PDT 2007


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?




More information about the Digitalmars-d-learn mailing list