src/corelib/tools/qmap.h
changeset 33 3e2da88830cd
parent 30 5dc02b23752f
child 37 758a864f9613
equal deleted inserted replaced
30:5dc02b23752f 33:3e2da88830cd
   975     { return QMap<Key, T>::insert(key, value); }
   975     { return QMap<Key, T>::insert(key, value); }
   976     inline typename QMap<Key, T>::iterator insert(const Key &key, const T &value)
   976     inline typename QMap<Key, T>::iterator insert(const Key &key, const T &value)
   977     { return QMap<Key, T>::insertMulti(key, value); }
   977     { return QMap<Key, T>::insertMulti(key, value); }
   978 
   978 
   979     inline QMultiMap &operator+=(const QMultiMap &other)
   979     inline QMultiMap &operator+=(const QMultiMap &other)
   980     { unite(other); return *this; }
   980     { this->unite(other); return *this; }
   981     inline QMultiMap operator+(const QMultiMap &other) const
   981     inline QMultiMap operator+(const QMultiMap &other) const
   982     { QMultiMap result = *this; result += other; return result; }
   982     { QMultiMap result = *this; result += other; return result; }
   983 
   983 
   984 #if !defined(Q_NO_USING_KEYWORD) && !defined(Q_CC_RVCT)
   984 #if !defined(Q_NO_USING_KEYWORD) && !defined(Q_CC_RVCT)
   985     // RVCT compiler doesn't handle using-keyword right when used functions are overloaded in child class
   985     // RVCT compiler doesn't handle using-keyword right when used functions are overloaded in child class
  1050     int n = 0;
  1050     int n = 0;
  1051     typename QMap<Key, T>::iterator i(find(key));
  1051     typename QMap<Key, T>::iterator i(find(key));
  1052     typename QMap<Key, T>::iterator end(QMap<Key, T>::end());
  1052     typename QMap<Key, T>::iterator end(QMap<Key, T>::end());
  1053     while (i != end && !qMapLessThanKey<Key>(key, i.key())) {
  1053     while (i != end && !qMapLessThanKey<Key>(key, i.key())) {
  1054         if (i.value() == value) {
  1054         if (i.value() == value) {
  1055 #if defined(Q_CC_RVCT)
  1055             i = this->erase(i);
  1056             // RVCT has problems with scoping, apparently.
       
  1057             i = QMap<Key, T>::erase(i);
       
  1058 #else
       
  1059             i = erase(i);
       
  1060 #endif
       
  1061             ++n;
  1056             ++n;
  1062         } else {
  1057         } else {
  1063             ++i;
  1058             ++i;
  1064         }
  1059         }
  1065     }
  1060     }