immutability - How do I find out if a class is immutable in C#? -


How can I find out that a square is irreversible in C #?

ImmutableObjectAttribute , but it is rarely used and poorly Is supported - and certainly not implemented (you have a floating object [irreversible object (true)] . AFAIK, this is the only thing that manages the IDE attributes (Such as not showing / showing the named properties).

Reality, you have to check out FieldInfo.IsInitOnly , but this Val applies to 100% irreversible types (no reflection is not considered abuse), it does not help with popcolic irreversibility, nor are things immutable in practice, but not in their implementation; that is, they are unstable publicly Can not be made to happen, but in theory this object supports it.

Here is a classic example string ... Everyone knows " That " string is irreversible ... exactly, replace < below the bonnet. No, seriously ...

It is so difficult to define the latency, let alone find it strong ...


Comments