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
This commit is contained in:
Dan Gohman 2010-09-01 14:00:35 +00:00
parent f8ff40c059
commit e3955df639
3 changed files with 4 additions and 5 deletions

View File

@ -185,13 +185,12 @@ public:
++NumTombstones;
return true;
}
bool erase(iterator I) {
void erase(iterator I) {
BucketT *TheBucket = &*I;
TheBucket->second.~ValueT();
TheBucket->first = getTombstoneKey();
--NumEntries;
++NumTombstones;
return true;
}
void swap(DenseMap& RHS) {

View File

@ -106,8 +106,8 @@ public:
const_iterator end() const { return ConstIterator(TheMap.end()); }
iterator find(const ValueT &V) { return Iterator(TheMap.find(V)); }
bool erase(Iterator I) { return TheMap.erase(I.I); }
bool erase(ConstIterator CI) { return TheMap.erase(CI.I); }
void erase(Iterator I) { return TheMap.erase(I.I); }
void erase(ConstIterator CI) { return TheMap.erase(CI.I); }
std::pair<iterator, bool> insert(const ValueT &V) {
return TheMap.insert(std::make_pair(V, 0));

View File

@ -149,7 +149,7 @@ public:
bool erase(const KeyT &Val) {
return Map.erase(Wrap(Val));
}
bool erase(iterator I) {
void erase(iterator I) {
return Map.erase(I.base());
}