Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Do not use a reference, pointer, or iterator that has been invalidated, as that results in undefined behavior. This rule is a specific instance of CTR32-CPP. Do not use iterators invalidated by container modificationUse valid references, pointers, and iterators to reference elements of a container.

Noncompliant Code Example

...

Search for vulnerabilities resulting from the violation of this rule on the CERT website.

Related Guidelines

Bibliography

[ISO/IEC 14882-2014]

21.4.1, "basic_string General Requirements"

[Meyers 01]Item 43: Prefer algorithm calls to hand-written loops

 

      07007. Characters and Strings (STR)      STR39-CPP. Range check element access