transporting qualifier from parameter to the return value

Jason House jason.james.house at gmail.com
Sat Dec 19 15:35:13 PST 2009


Steven Schveighoffer Wrote:

> On Fri, 18 Dec 2009 22:18:36 -0500, Leandro Lucarella <llucax at gmail.com>  
> wrote:
> 
> > Looks like inout won:
> > http://www.dsource.org/projects/phobos/changeset/1389
> >
> > Doesn't look like a very intuitive name though (another enum? :).
> >
> 
> Better than not having the feature :)
> 
> Some notes on the to-be description:
> 
> There is no mention that inout variables cannot be changed (they cannot).
> 
> In the paragraph describing what inout resolves to on return, if all  
> matches are inout, then the return type should be set to inout, not  
> const.  This is important for calling inout functions from within inout  
> functions.
> 
> I'm really excited to finally see this coming to fruition!  Thanks Walter  
> and Andrei!
> 
> -Steve

The docs should also discuss inout variables declared within the function (to store intermediate results while processing input arguments). The meaning of inout by a nested function isn't obvious when the enclosing function is already using inout. Does inout of the nested function match that of the enclosing function? Or are they distinct. If distinct, there may semantically ambiguous cases...



More information about the Digitalmars-d mailing list