Passing arguments into functions - in, out, inout, const, and contracts

Jason House jason.james.house at gmail.com
Sat Feb 10 22:09:33 PST 2007


I believe that everything (except maybe fundamental types such as int) 
are passed by reference.  I'd expect "in" parameters to be considered 
const, but I know that member functions can't be declared const.

It seems to me that in/out/inout has no effect on how the language 
operates.  I'm wondering how those affect the language.  Does "in" 
impose a contract that the ending value must equal the starting value? 
I also haven't thought of any good way to differentiate out from inout 
from the compiler's standpoint (obviously, it makes sense to users).


More information about the Digitalmars-d-learn mailing list