Question: I would like to traverse a map in C++ with iterators but not all the way to the end.
The problem is that even if we can do basic operations with iterators, we cannot add or compare iterators with integers.
How can I write the following instructions? (`final` is a map; `window`, an integer)

```
for (it=final.begin(); it!=final.end()-window; it++)

```

Answer: 
```
std::map<T1, T2>::iterator it = final.begin();
for (int i = 0; i < final.size()-window; ++i, ++it)
{
  // TODO: add your normal loop body
}

```

Replace `T1` and `T2` with the actual types of the keys and values of the map.
Why don't you make 'it' an iterator as well ? 

See the example here : <http://www.cplusplus.com/reference/stl/map/begin/>