By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,750 Members | 1,199 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,750 IT Pros & Developers. It's quick & easy.

mmap iterator validity

P: n/a
Hi,

if I insert an item in a mmap m:

mmap<Tkey, TObj> m;

mmap<Tkey, TObj>::iterator p1 = m.insert(make_pair(key, obj));

how long will be valid the p1 iterator if I made other insert and/or remove
operation after this insertion?

Marco

Jul 23 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Marco Cassiani wrote:
if I insert an item in a mmap m:

mmap<Tkey, TObj> m;

mmap<Tkey, TObj>::iterator p1 = m.insert(make_pair(key, obj));

how long will be valid the p1 iterator if I made other insert and/or remove
operation after this insertion?


Iterators and references to elements of std::map are only invalidated
when the elements themselves are removed.

V
Jul 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.