diff options
author | Ted Kremenek <kremenek@apple.com> | 2008-05-03 01:05:46 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2008-05-03 01:05:46 +0000 |
commit | f5afbb2d339e48b18b6de02185478eda186898b7 (patch) | |
tree | 682d95bcbc96c569afab7bd20237f8a3ce63dc6b /include/llvm | |
parent | f90f8f8bc5ad215a6c7d07f8479cb39f1f2d2c29 (diff) | |
download | external_llvm-f5afbb2d339e48b18b6de02185478eda186898b7.zip external_llvm-f5afbb2d339e48b18b6de02185478eda186898b7.tar.gz external_llvm-f5afbb2d339e48b18b6de02185478eda186898b7.tar.bz2 |
Implement operator-> for ImmutableMap iterators.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50603 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm')
-rw-r--r-- | include/llvm/ADT/ImmutableMap.h | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/include/llvm/ADT/ImmutableMap.h b/include/llvm/ADT/ImmutableMap.h index 27148e6..6a551db 100644 --- a/include/llvm/ADT/ImmutableMap.h +++ b/include/llvm/ADT/ImmutableMap.h @@ -176,16 +176,19 @@ public: friend class ImmutableMap; public: - inline value_type_ref operator*() const { return itr->getValue(); } - inline key_type_ref getKey() const { return itr->getValue().first; } - inline data_type_ref getData() const { return itr->getValue().second; } + value_type_ref operator*() const { return itr->getValue(); } + value_type* operator->() const { return &itr->getValue(); } - inline iterator& operator++() { ++itr; return *this; } - inline iterator operator++(int) { iterator tmp(*this); ++itr; return tmp; } - inline iterator& operator--() { --itr; return *this; } - inline iterator operator--(int) { iterator tmp(*this); --itr; return tmp; } - inline bool operator==(const iterator& RHS) const { return RHS.itr == itr; } - inline bool operator!=(const iterator& RHS) const { return RHS.itr != itr; } + key_type_ref getKey() const { return itr->getValue().first; } + data_type_ref getData() const { return itr->getValue().second; } + + + iterator& operator++() { ++itr; return *this; } + iterator operator++(int) { iterator tmp(*this); ++itr; return tmp; } + iterator& operator--() { --itr; return *this; } + 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; } }; iterator begin() const { return iterator(Root); } |