On 7/2/2017 6:33 AM, Timon Gehr wrote:
The best way to think about inout is that it enables a function to have three
distinct signatures:
inout(int)[] foo(inout(int)[] arg);
"expands" to:
int[] foo(int[] arg);
immutable(int)[] foo(immutable(int)[] arg);
const(int)[] foo(const(int)[] arg);
const inout /does not change this in any way/:
const(inout(int))[] foo(inout(int)[] arg);
expands to:
const(int)[] foo(int[] arg);
const(immutable(int))[] foo(immutable(int)[] arg);
const(const(int))[] foo(const(int)[] arg);
Thank you. This explanation makes sense (given that applying const to immutable
=> immutable).