Versions Compared

Key

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

...

In this non-compliant example, the two iterators that delimit the range point into the same container, but the first iterator doesn't actually precede the second.

Code Block
bgColor#FFcccc
langcpp
for_each( c.end(), c.begin(), Something );

...

The second common case arises when the iterators point into different containers:

Code Block
bgColor#FFcccc
langcpp
for_each( c.begin(), d.end(), Something );

...

Compliant Solution

Code Block
bgColor#ccccff
langcpp
for_each( c.begin(), c.end(), Something );

...