Add iterator_traits to ImmutableMap and ImmutableSet.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175085 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Ryan Govostes 2013-02-13 21:38:22 +00:00
parent 7b0bc3fe3e
commit 3df02ac9d4
2 changed files with 10 additions and 0 deletions

View File

@ -224,6 +224,11 @@ public:
iterator operator--(int) { iterator tmp(*this); --itr; return tmp; }
bool operator==(const iterator& RHS) const { return RHS.itr == itr; }
bool operator!=(const iterator& RHS) const { return RHS.itr != itr; }
typedef ImmutableMap<KeyT,ValT,ValInfo>::value_type value_type;
typedef value_type *pointer;
typedef value_type &reference;
typedef std::bidirectional_iterator_tag iterator_category;
};
iterator begin() const { return iterator(Root); }

View File

@ -1066,6 +1066,11 @@ public:
inline bool operator==(const iterator& RHS) const { return RHS.itr == itr; }
inline bool operator!=(const iterator& RHS) const { return RHS.itr != itr; }
inline value_type *operator->() const { return &(operator*()); }
typedef ImmutableSet<ValT,ValInfo>::value_type value_type;
typedef value_type *pointer;
typedef value_type &reference;
typedef std::bidirectional_iterator_tag iterator_category;
};
iterator begin() const { return iterator(Root); }