How come isMutable returns true for structs that cannot be modified

aliak something at something.com
Fri Jul 27 13:10:04 UTC 2018


import std.traits: isMutable;
struct S {
     immutable int i = 3;
}

pragma(msg, isMutable!S);

void main() {
     S s;
     s = S();
}

And is there a trait that takes the transitivity of immutability 
in to account?

Cheers,
- Ali


More information about the Digitalmars-d-learn mailing list