
On 20 October 2010 21:07, Jeremy Stribling
Anyone here know the answer to this question?
http://stackoverflow.com/questions/3981123/passing-a-boostunordered-set-as-t...
The problem is in this code from boost/unordered/detail/unique.hpp: key_type const& k = extractor::extract(*i); std::size_t hash_value = this->hash_function()(k); bucket_ptr bucket = this->bucket_ptr_from_hash(hash_value); node_ptr pos = this->find_iterator(bucket, k); It seems that the dereferenced iterator value is destroyed before hash_function is called. I was under the impression that it was safe to use that reference until the next time the iterator is used. If that's right, then it's a bug in split, if that's wrong then it's a bug in unordered_set. The attached patch is a workaround/fix. Daniel