------- Additional Comments From bkoz at gcc dot gnu dot org  2005-09-25 18:09 
-------
Here's the code in question. It looks like the other erase MF's return void, so
perhaps this is just an oversight. However, there appears to be some confusion
WRT what this function should return, based on the preceeding erase MF's 
comments: 

  // XXX We're following the TR in giving this a return type of void,
  // but that ought to change.  The return type should be const_iterator,
  // and it should return the iterator following the one we've erased.
  // That would simplify range erase.


anyway.

  template<typename K, typename V, 
           typename A, typename Ex, typename Eq,
           typename H1, typename H2, typename H, typename RP,
           bool c, bool m, bool u>
    typename hashtable<K, V, A, Ex, Eq, H1, H2, H, RP, c, m, u>::size_type
    hashtable<K, V, A, Ex, Eq, H1, H2, H, RP, c, m, u>::
    erase(const key_type& k)
    {
      typename hashtable::hash_code_t code = this->m_hash_code (k);
      size_type n = this->bucket_index(k, code, m_bucket_count);
      
      node** slot = m_buckets + n;
      while (*slot && ! this->compare (k, code, *slot))
        slot = &((*slot)->m_next);

      while (*slot && this->compare (k, code, *slot))
        {
          node* n = *slot;
          *slot = n->m_next;
          m_deallocate_node (n);
          --m_element_count;
        }
    }


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24054

Reply via email to