Make ADLResult::iterator a proper iterator.

PR17796.

llvm-svn: 193986
This commit is contained in:
Benjamin Kramer 2013-11-04 10:29:56 +00:00
parent d9a5e2a490
commit a1ced436b1
1 changed files with 3 additions and 2 deletions

View File

@ -733,7 +733,8 @@ public:
Decls.erase(cast<NamedDecl>(D->getCanonicalDecl()));
}
class iterator {
class iterator
: public std::iterator<std::forward_iterator_tag, NamedDecl *> {
typedef llvm::DenseMap<NamedDecl*,NamedDecl*>::iterator inner_iterator;
inner_iterator iter;
@ -745,7 +746,7 @@ public:
iterator &operator++() { ++iter; return *this; }
iterator operator++(int) { return iterator(iter++); }
NamedDecl *operator*() const { return iter->second; }
value_type operator*() const { return iter->second; }
bool operator==(const iterator &other) const { return iter == other.iter; }
bool operator!=(const iterator &other) const { return iter != other.iter; }