use const iterators for insert/emplace and erase