C# Class Design Handbook
In the discussion of GetHashCode on pp. 80-81, the authors state that the "hash code should be based on immutable members". Yet, in the example, it is partially based on the "balance" member, which doesn't seem immutable to me. Am I missing something here, or is there an inconsistency between the rules and the example?
Thanks...
Dan
P.S. BTW, I'm finding this book well-written, concise and informative in a detailed way.
|