[llvm] r175085 - Add iterator_traits to ImmutableMap and ImmutableSet.

Ryan Govostes rzg at apple.com
Wed Feb 13 13:38:22 PST 2013


Author: rgov
Date: Wed Feb 13 15:38:22 2013
New Revision: 175085

URL: http://llvm.org/viewvc/llvm-project?rev=175085&view=rev
Log:
Add iterator_traits to ImmutableMap and ImmutableSet.

Modified:
    llvm/trunk/include/llvm/ADT/ImmutableMap.h
    llvm/trunk/include/llvm/ADT/ImmutableSet.h

Modified: llvm/trunk/include/llvm/ADT/ImmutableMap.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/ImmutableMap.h?rev=175085&r1=175084&r2=175085&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/ImmutableMap.h (original)
+++ llvm/trunk/include/llvm/ADT/ImmutableMap.h Wed Feb 13 15:38:22 2013
@@ -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); }

Modified: llvm/trunk/include/llvm/ADT/ImmutableSet.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/ImmutableSet.h?rev=175085&r1=175084&r2=175085&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/ImmutableSet.h (original)
+++ llvm/trunk/include/llvm/ADT/ImmutableSet.h Wed Feb 13 15:38:22 2013
@@ -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); }





More information about the llvm-commits mailing list