...
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 | ||||
---|---|---|---|---|
| ||||
for_each( c.end(), c.begin(), Something ); |
...
The second common case arises when the iterators point into different containers:
Code Block | ||||
---|---|---|---|---|
| ||||
for_each( c.begin(), d.end(), Something ); |
...
Compliant Solution
Code Block | ||||
---|---|---|---|---|
| ||||
for_each( c.begin(), c.end(), Something ); |
...