I read that as saying that the code in the mail at the start of this thread is perfectly safe, don't you?
Well, we also have:
template<class _Traits> class _Tree { const_iterator find(const key_type& _Keyval) const { // find an element in nonmutable sequence that matches _Keyval const_iterator _Where = lower_bound(_Keyval); return (_Where == end() || this->comp(_Keyval, _Key(_Where._Mynode())) ? end() : _Where); } }
The find method might return a temporary const_iterator, but I can't tell whether this is a problem or not.
Regards, Asger