still confused about call by reference

Hoenir mrmocool at gmx.de
Thu Nov 1 03:39:28 PDT 2007


> In D that's written:
> 
> void foo(ref Struct S)
> {...}
> 
> And called like:
> 
> Struct s;
> foo(s);
> 
> --bb

Ok, but ref is an alias for inout atm. And I think "in" is implicitly 
used if nothing other is specified, isn't it?
So how would I pass a struct by reference but without being able to 
write (const & in C++)? and does this make sense(why is struct a value 
type)?

Please excuse my noob questions. :-)


More information about the Digitalmars-d-learn mailing list