The comment in stl_pair.h
is misleading in this specific case.
There will be no copy, since the map::iterator
actually refers to the original data inside the map (the value_type
, which itself is a pair
), it’s not a copy. Thus iterator::second
also refers to the original data.