[LLVMbugs] [Bug 6548] New: DenseSet::iterator doesn't have std iterator traits

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Mar 8 11:54:15 PST 2010


           Summary: DenseSet::iterator doesn't have std iterator traits
           Product: libraries
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Core LLVM classes
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: alenhar2 at uiuc.edu
                CC: llvmbugs at cs.uiuc.edu

DenseMap has difference_type, iterator_category, etc, but DenseSet doesn't. 
This prevents using set iterators with calls, such as insert, on std

Something like the below fixes this  (any chance this can be fixed for 2.7?):

--- include/llvm/ADT/DenseSet.h (revision 97942)
+++ include/llvm/ADT/DenseSet.h (working copy)
@@ -55,6 +55,13 @@
   class Iterator {
     typename MapTy::iterator I;
+    typedef typename MapTy::iterator::difference_type difference_type;
+    typedef ValueT value_type;
+    typedef value_type *pointer;
+    typedef value_type &reference;
+    typedef std::forward_iterator_tag iterator_category;
     Iterator(const typename MapTy::iterator &i) : I(i) {}

     ValueT& operator*() { return I->first; }

Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

More information about the llvm-bugs mailing list