Parameter storage class 'in' transitive like 'const'?
Jakob Ovrum via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Sun May 3 00:52:15 PDT 2015
On Sunday, 3 May 2015 at 05:20:34 UTC, Ali Çehreli wrote:
> We know that 'in' is "equivalent to const scope":
>
> http://dlang.org/function.html#parameters
>
> So, the constness of 'in' is transitive as well, right?
>
> Ali
Of course, there's no concept of non-transitive const in D:
struct S
{
char[] str;
}
void foo(in S s)
{
pragma(msg, typeof(s.str)); // const(char[])
}
More information about the Digitalmars-d-learn
mailing list