summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-05-03 01:05:46 +0000
committerTed Kremenek <kremenek@apple.com>2008-05-03 01:05:46 +0000
commit7a07428ad1015306d7235cabebd5f4f78e62d33c (patch)
tree682d95bcbc96c569afab7bd20237f8a3ce63dc6b /include
parent22b942aa4df824adbd3f6eaede53abe451f616e9 (diff)
downloadllvm-7a07428ad1015306d7235cabebd5f4f78e62d33c.tar.gz
llvm-7a07428ad1015306d7235cabebd5f4f78e62d33c.tar.bz2
llvm-7a07428ad1015306d7235cabebd5f4f78e62d33c.tar.xz
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')
-rw-r--r--include/llvm/ADT/ImmutableMap.h21
1 files changed, 12 insertions, 9 deletions
diff --git a/include/llvm/ADT/ImmutableMap.h b/include/llvm/ADT/ImmutableMap.h
index 27148e6083..6a551db690 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); }