Providing an invalid ordering rule for an associative container or as a comparison criterion with the sorting algorithms can result in erratic behavior or infinite loops. (See Meyers01 §21 §21 for examples.)
Non-Compliant Code Example
...
Rule | Severity | Likelihood | Remediation Cost | Priority | Level |
---|---|---|---|---|---|
STL32-C | 1 (low) | 2 (probable) | 1 (high) | P2 | L3 |
References
Wiki Markup |
---|
\[[Meyers 01|AA. C++ References#Meyers 01]\] Item 21: Always have comparison functions return false for equal values. |
...
\[[Sutter 05|AA. C++ References#Sutter 05]\] Item 83: Use a checked STL implementation. \[[ISO/IEC 14882-2003|AA. C++ References#ISO/IEC 14882-2003]\] Section 24: Iterators Library. |