title: Is it possible for std::multimap::equal_range to return incorrect results?
body: <p>Good afternoon,  I am finding that <code>std:multimap::equal_range</code> returns incorrect results sometimes. Is this possible? If so, is there a workaround or some error in my code or hash function for pointers. Thank you. </p>
  
  <p>Here is an excerpt of my code: </p>
  
  <pre><code>typedef std::multimap&lt;char *,Range&gt;::const_iterator I;
  std::pair&lt;I,I&gt; b = mmultimap.equal_range(TmpPrevMapPtr);
  for (I i=b.first; i != b.second; ++i){
      ranges_type.erase(i-&gt;second);
  }
  erasecount = mmultimap.erase(TmpPrevMapPtr);
  </code></pre>
  
  <p>where mmultimap has a hashed pointer key and a Range value. The class Range looks like this:    </p>
  
  <pre><code>class Range { 
  public:   
      explicit Range(int item){// [item,item] 
        mLow = item;
        mHigh = item;
        mPtr  = 0;
        mMapPtr = 0;
        mStamp = 0;
      }
  
      Range(int low, int high, char* ptr = 0,char* mapptr, int stamp){  
        mLow = low;
        mHigh = high;
        mPtr  = ptr;
        mMapPtr = mapptr;
        mStamp = stamp;
      }        
  
      int low() const { return mLow; }   
      int high() const { return mHigh; }
      char* getPtr() const { return mPtr; }
      char* getMapPtr() const { return mMapPtr; }
      int getStamp() const { return mStamp; }
  
  private:   
      int mLow;   
      int mHigh; 
      char* mPtr;
      char* mMapPtr;
      int mStamp;
  }; // class Range 
  </code></pre>