
Rodolfo Lima skrev:
Thorsten Ottosen escreveu:
iterator insert( iterator, ref_pair
). such that we can insert an element from another ptr_map.
Would this be satisfactory?
Hi, I was thinking of something along the lines of
iterator insert(iterator, const key_type &key, std::auto_ptr<T> ptr);
and
iterator insert(iterator, const key_type &key, mapped_type val);
to mimic the insert overload that doesn't take the iterator.
Ok. I'll add those.
And while you're at it, I've noticed that the member std::pair
ptr_map_adapter::iterator(key_type &key, mapped_type x) takes the key as a non-const reference, is there a reason for that?
Yes. It provides stronger exception-safety guarantees (though not bullet-proof) since then creating a key must be done in a seperate statement. -Thorsten