“const correctness” in C#
问题 The point of const-correctness is to be able to provide a view of an instance that can't be altered or deleted by the user. The compiler supports this by pointing out when you break constness from within a const function, or try to use a non-const function of a const object. So without copying the const approach, is there a methodology I can use in C# that has the same ends? I'm aware of immutability, but that doesn't really carry over to container objects to name but one example. 回答1: I've