llvm.org GIT mirror llvm / e3955df
Make the iterator form of erase return void, since it always succeeds, and since this is what std::map and std::set do. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112701 91177308-0d34-0410-b5e6-96231b3b80d8 Dan Gohman 10 years ago
3 changed file(s) with 4 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
184184 ++NumTombstones;
185185 return true;
186186 }
187 bool erase(iterator I) {
187 void erase(iterator I) {
188188 BucketT *TheBucket = &*I;
189189 TheBucket->second.~ValueT();
190190 TheBucket->first = getTombstoneKey();
191191 --NumEntries;
192192 ++NumTombstones;
193 return true;
194193 }
195194
196195 void swap(DenseMap& RHS) {
105105 const_iterator end() const { return ConstIterator(TheMap.end()); }
106106
107107 iterator find(const ValueT &V) { return Iterator(TheMap.find(V)); }
108 bool erase(Iterator I) { return TheMap.erase(I.I); }
109 bool erase(ConstIterator CI) { return TheMap.erase(CI.I); }
108 void erase(Iterator I) { return TheMap.erase(I.I); }
109 void erase(ConstIterator CI) { return TheMap.erase(CI.I); }
110110
111111 std::pair insert(const ValueT &V) {
112112 return TheMap.insert(std::make_pair(V, 0));
148148 bool erase(const KeyT &Val) {
149149 return Map.erase(Wrap(Val));
150150 }
151 bool erase(iterator I) {
151 void erase(iterator I) {
152152 return Map.erase(I.base());
153153 }
154154