map, begin() method example

In this article,

http://www.cplusplus.com/reference/map/map/begin/

the iterator returned by std::map::begin() is beeing incremented before the first use.

is this intentional or an error? i usually know those stl begin() functions to return the first element in the container so that the code as is would skip the first element.

am I wrong here? I am a little unsecure.
I don't see it incremented before first use. Can you point the step?


Edit: 'it' is declared twice though. First on the scope of main, and then again in the for-clause.
Last edited on
the iterator returned by std::map::begin() is beeing incremented before the first use.

Um, no it isn't. The value of it at the start of the loop is:
it=mymap.begin()

Where do you think it's being incremented before the first use?
Last edited on
Topic archived. No new replies allowed.