| High Integrity CPP Rule 17.15 | Never modify the key part of a set or multiset element. |
| Justification |
sets and multisets sort elements as they are inserted into the container, therefore any change to an element that affects its sort position will corrupt the container and result in very hard to find bugs. |
| See also |
Rule 17.14 |
| Reference |
Effective STL Item 22; |