Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0

...

Pointers and references to objects within a container are also invalidated when iterators are invalidated. A single exception applies for the deque class: it preserves pointers and references to internal objects upon inserts to either its beginning or its end, but it does not preserve iterators.

Wiki MarkupConsequently, the values of existing iterators may be invalidated \ [[Kalev 99|AA. Bibliography#Kalev 99]\]. Using invalid iterators yields undefined results.

Non-Compliant Code Example

...

Rule

Severity

Likelihood

Remediation Cost

Priority

Level

ARR32-CPP

high

probable

high

P6

L2

Bibliography

...

\[[Meyers 01|AA. Bibliography#Meyers 01]\] Item 43: Prefer algorithm calls to hand-written loops. \
[[Sutter 04|AA. Bibliography#Sutter 04]\] Item 84: Prefer algorithm calls to handwritten loops. \[
[Kalev 99|AA. Bibliography#Kalev 99] \] ANSI/ISO C+\+ Professional Programmer's Handbook. \
[[ISO/IEC 14882-2003|AA. Bibliography#ISO/IEC 14882-2003]\] Section 24: Iterators Library.

...

ARR31-CPP. Use consistent array notation across all source files      06. Arrays and the STL (ARR)      ARR33-CPP. Guarantee that copies are made into storage of sufficient size