Synopsis: | Do not modify the value of any of the operands in the implementation of an overloaded operator |
Language: | C# |
Severity Level: | 1 |
Category: | Object oriented |
Description: |
This rule can be found in a non-normative clause of [C# Lang], section 17.9.1. Breaking this rule gives counter-intuitive results. public static PatientList operator + (PatientList list, Patient p) { list += p; return list; } |
Literature References: |
C# Lang 17.9.1 |