Examples showing how to iterate over a std::map
are often like that:
MapType::const_iterator end = data.end();
for (MapType::const_iterator it = data.begin(); it != end; ++it)
i.e. it uses ++it
instead of it++
. Is there any reason why? Could there be any problem if I use it++
instead?