Next: High Integrity CPP Guideline 17.16  Up: 17 Standard Template Library (STL)  Previous: High Integrity CPP Rule 17.14  Contents

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;


HICPP VERSION 2.4  http://www.codingstandard.com   Copyright: © 2007 THE PROGRAMMING RESEARCH GROUP