[llvm-commits] [llvm] r50603 - /llvm/trunk/include/llvm/ADT/ImmutableMap.h
Ted Kremenek
kremenek at apple.com
Fri May 2 18:05:46 PDT 2008
Author: kremenek
Date: Fri May 2 20:05:46 2008
New Revision: 50603
URL: http://llvm.org/viewvc/llvm-project?rev=50603&view=rev
Log:
Implement operator-> for ImmutableMap iterators.
Modified:
llvm/trunk/include/llvm/ADT/ImmutableMap.h
Modified: llvm/trunk/include/llvm/ADT/ImmutableMap.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/ImmutableMap.h?rev=50603&r1=50602&r2=50603&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/ImmutableMap.h (original)
+++ llvm/trunk/include/llvm/ADT/ImmutableMap.h Fri May 2 20:05:46 2008
@@ -176,16 +176,19 @@
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); }
More information about the llvm-commits
mailing list