in, out and inout for function arguments
Craig Black
cblack at ara.com
Thu Oct 12 07:27:09 PDT 2006
> When 'inout' is used, it is usually as a compromise to improve
> performance.
> For example, it can be a performance cost to copy large structs or
> fixed-length arrays betwen functions, and 'inout' is a way to avoid that.
And I think that is gay. 'inout' should not be required to pass an argument
by reference.
IMO 'in' should pass by reference, but denote a read only parameter. This
would be better
for performance and correctness.
-Craig
More information about the Digitalmars-d
mailing list