class string
is immutable. It is impossible implementing an immutable struct type as you can't disable or override assignment operation (=
). Even you define a readonly struct, you can always change the value of the struct type by using assignment operator.
For example, x,y
are values of a readonly struct. x = y;
will change the content of x
. So, the readonly struct section in C# language reference is not correct. Is this right?