src/corelib/tools/qhash.h
changeset 29 b72c6db6890b
parent 18 2f34d5167611
child 30 5dc02b23752f
equal deleted inserted replaced
25:e24348a560a6 29:b72c6db6890b
   925 
   925 
   926     inline typename QHash<Key, T>::iterator insert(const Key &key, const T &value)
   926     inline typename QHash<Key, T>::iterator insert(const Key &key, const T &value)
   927     { return QHash<Key, T>::insertMulti(key, value); }
   927     { return QHash<Key, T>::insertMulti(key, value); }
   928 
   928 
   929     inline QMultiHash &operator+=(const QMultiHash &other)
   929     inline QMultiHash &operator+=(const QMultiHash &other)
   930     { unite(other); return *this; }
   930     { this->unite(other); return *this; }
   931     inline QMultiHash operator+(const QMultiHash &other) const
   931     inline QMultiHash operator+(const QMultiHash &other) const
   932     { QMultiHash result = *this; result += other; return result; }
   932     { QMultiHash result = *this; result += other; return result; }
   933 
   933 
   934 #if !defined(Q_NO_USING_KEYWORD) && !defined(Q_CC_RVCT)
   934 #if !defined(Q_NO_USING_KEYWORD) && !defined(Q_CC_RVCT)
   935     // RVCT compiler doesn't handle using-keyword right when used functions are overloaded in child class
   935     // RVCT compiler doesn't handle using-keyword right when used functions are overloaded in child class
  1000     int n = 0;
  1000     int n = 0;
  1001     typename QHash<Key, T>::iterator i(find(key));
  1001     typename QHash<Key, T>::iterator i(find(key));
  1002     typename QHash<Key, T>::iterator end(QHash<Key, T>::end());
  1002     typename QHash<Key, T>::iterator end(QHash<Key, T>::end());
  1003     while (i != end && i.key() == key) {
  1003     while (i != end && i.key() == key) {
  1004         if (i.value() == value) {
  1004         if (i.value() == value) {
  1005 #if defined(Q_CC_RVCT)
  1005             i = this->erase(i);
  1006             // RVCT has problems with scoping, apparently.
       
  1007             i = QHash<Key, T>::erase(i);
       
  1008 #else
       
  1009             i = erase(i);
       
  1010 #endif
       
  1011             ++n;
  1006             ++n;
  1012         } else {
  1007         } else {
  1013             ++i;
  1008             ++i;
  1014         }
  1009         }
  1015     }
  1010     }