--- Comment #5 from Steven Schveighoffer <> 2011-08-31 
12:11:15 PDT ---
it is not debateable.  The issue is, when inside an inout-enabled function, all
inout variables are *assignable* from other inout variables.

So for example, if you have:

inout(int) * globalvar;

inout(int)* foo(inout(int)* x)
   return globalvar;

void main()
   int x;
   auto y = foo(&x);

what type is y?  inout(T) is changed to just T in this scenario, since the
constancy factor is mutable, so essentially, you now have a mutable pointer to
what is treated as const as you say.

The type system *must* prevent non-local variables (i.e. variables not on the
stack) from being inout.  Otherwise, you cannot make guarantees about inout.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to