Changeset 12321 in webkit for trunk/JavaScriptCore/kxmlcore/HashSet.h
- Timestamp:
- Jan 23, 2006, 4:56:32 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kxmlcore/HashSet.h
r12301 r12321 80 80 bool contains(const ValueType& value) const; 81 81 82 std::pair<iterator, bool> insert(const ValueType &value); 83 84 // a special version of insert() that finds the object by hashing and comparing 82 // the return value is a pair of an interator to the new value's location, 83 // and a bool that is true if an new entry was added 84 std::pair<iterator, bool> add(const ValueType &value); 85 86 // a special version of add() that finds the object by hashing and comparing 85 87 // with some other type, to avoid the cost of type conversion if the object is already 86 88 // in the table. HashTranslator should have the following methods: … … 89 91 // static translate(ValueType&, const T&, unsigned hashCode); 90 92 template<typename T, typename HashTranslator> 91 std::pair<iterator, bool> insert(const T& value);93 std::pair<iterator, bool> add(const T& value); 92 94 93 95 void remove(const ValueType& value); … … 160 162 161 163 template<typename Value, typename HashFunctions, typename Traits> 162 std::pair<typename HashSet<Value, HashFunctions, Traits>::iterator, bool> HashSet<Value, HashFunctions, Traits>:: insert(const ValueType &value)163 { 164 return m_impl. insert(value);164 std::pair<typename HashSet<Value, HashFunctions, Traits>::iterator, bool> HashSet<Value, HashFunctions, Traits>::add(const ValueType &value) 165 { 166 return m_impl.add(value); 165 167 } 166 168 167 169 template<typename Value, typename HashFunctions, typename Traits> 168 170 template<typename T, typename HashSetTranslator> 169 std::pair<typename HashSet<Value, HashFunctions, Traits>::iterator, bool> HashSet<Value, HashFunctions, Traits>:: insert(const T& value)170 { 171 return m_impl.template insert<T, T, HashSetTranslatorAdapter<ValueType, T, HashSetTranslator> >(value, value);171 std::pair<typename HashSet<Value, HashFunctions, Traits>::iterator, bool> HashSet<Value, HashFunctions, Traits>::add(const T& value) 172 { 173 return m_impl.template add<T, T, HashSetTranslatorAdapter<ValueType, T, HashSetTranslator> >(value, value); 172 174 } 173 175
Note:
See TracChangeset
for help on using the changeset viewer.