fixes and enhancements in libcpp
authorLisandro Dalcin <dalcinl@gmail.com>
Wed, 6 Oct 2010 22:46:12 +0000 (19:46 -0300)
committerLisandro Dalcin <dalcinl@gmail.com>
Wed, 6 Oct 2010 22:46:12 +0000 (19:46 -0300)
Cython/Includes/libcpp/deque.pxd
Cython/Includes/libcpp/list.pxd
Cython/Includes/libcpp/map.pxd
Cython/Includes/libcpp/pair.pxd
Cython/Includes/libcpp/set.pxd
Cython/Includes/libcpp/utility.pxd [new file with mode: 0644]
Cython/Includes/libcpp/vector.pxd

index fc0a4913b0e7010566d85b4eed82757fa1aeed01..62965ae5a4d0e1c817882b6901c6e92a9a3a264a 100644 (file)
@@ -12,8 +12,8 @@ cdef extern from "<deque>" namespace "std":
             T& operator*()
             iterator operator++()
             iterator operator--()
-            bint operator==(iterator)
-            bint operator!=(iterator)
+            bint operator==(reverse_iterator)
+            bint operator!=(reverse_iterator)
         #cppclass const_iterator(iterator):
         #    pass
         #cppclass const_reverse_iterator(reverse_iterator):
index b395f7d636f1359524b8307cff4c5e46f005534c..0b6eb1dcb2bed188418d55a394f5edbe7238e98a 100644 (file)
@@ -10,8 +10,8 @@ cdef extern from "<list>" namespace "std":
             T& operator*()
             iterator operator++()
             iterator operator--()
-            bint operator==(iterator)
-            bint operator!=(iterator)
+            bint operator==(reverse_iterator)
+            bint operator!=(reverse_iterator)
         #cppclass const_iterator(iterator):
         #    pass
         #cppclass const_reverse_iterator(reverse_iterator):
@@ -30,6 +30,7 @@ cdef extern from "<list>" namespace "std":
         T& back()
         iterator begin()
         #const_iterator begin()
+        void clear()
         bint empty()
         iterator end()
         #const_iterator end()
index 78c8cd9925fca9a9c6ef5eb8dc22815acb7d906a..4768a54d484f19bc8bd6434424a8cbb496d21515 100644 (file)
@@ -1,4 +1,4 @@
-from pair cimport pair
+from utility cimport pair
 
 cdef extern from "<map>" namespace "std":
     cdef cppclass map[T, U]:
@@ -9,11 +9,11 @@ cdef extern from "<map>" namespace "std":
             bint operator==(iterator)
             bint operator!=(iterator)
         cppclass reverse_iterator:
-            pair[T,U] operator*()
+            pair[T,U]& operator*()
             iterator operator++()
             iterator operator--()
-            bint operator==(iterator)
-            bint operator!=(iterator)
+            bint operator==(reverse_iterator)
+            bint operator!=(reverse_iterator)
         #cppclass const_iterator(iterator):
         #    pass
         #cppclass const_reverse_iterator(reverse_iterator):
index da0eb7731e36ed5ed1830687de2ee4737dd513fb..0915eee3c13fd2ec976d521e27b2120007f27bd7 100644 (file)
@@ -1,7 +1 @@
-cdef extern from "<utility>" namespace "std":
-    cdef cppclass pair[T, U]:
-        T first
-        U second
-        pair()
-        pair(pair&)
-        pair(T&, U&)
+from utility cimport pair
index 6d6607ee4eaebc2ad47320784fbdae5ac027c492..89a6f557e6bff7a697e1d00206918c7b781da314 100644 (file)
@@ -3,17 +3,17 @@ from pair cimport pair
 cdef extern from "<set>" namespace "std":
     cdef cppclass set[T]:
         cppclass iterator:
-            T operator*()
+            T& operator*()
             iterator operator++()
             iterator operator--()
             bint operator==(iterator)
             bint operator!=(iterator)
         cppclass reverse_iterator:
-            T operator*()
+            T& operator*()
             iterator operator++()
             iterator operator--()
-            bint operator==(iterator)
-            bint operator!=(iterator)
+            bint operator==(reverse_iterator)
+            bint operator!=(reverse_iterator)
         #cppclass const_iterator(iterator):
         #    pass
         #cppclass const_reverse_iterator(reverse_iterator):
diff --git a/Cython/Includes/libcpp/utility.pxd b/Cython/Includes/libcpp/utility.pxd
new file mode 100644 (file)
index 0000000..1d8ead7
--- /dev/null
@@ -0,0 +1,13 @@
+cdef extern from "<utility>" namespace "std":
+    cdef cppclass pair[T, U]:
+        T first
+        U second
+        pair()
+        pair(pair&)
+        pair(T&, U&)
+        bint operator==(pair&, pair&)
+        bint operator!=(pair&, pair&)
+        bint operator<(pair&, pair&)
+        bint operator>(pair&, pair&)
+        bint operator<=(pair&, pair&)
+        bint operator>=(pair&, pair&)
index 61c6aefbc8a2f474506fba443c61b55f020d1ede..0ec557027292b306cabc85f20b8b9df10c3ddeba 100644 (file)
@@ -6,8 +6,8 @@ cdef extern from "<vector>" namespace "std":
             iterator operator--()
             bint operator==(iterator)
             bint operator!=(iterator)
-            bint operator< (iterator)
-            bint operator> (iterator)
+            bint operator<(iterator)
+            bint operator>(iterator)
             bint operator<=(iterator)
             bint operator>=(iterator)
         cppclass reverse_iterator:
@@ -16,8 +16,8 @@ cdef extern from "<vector>" namespace "std":
             iterator operator--()
             bint operator==(reverse_iterator)
             bint operator!=(reverse_iterator)
-            bint operator< (reverse_iterator)
-            bint operator> (reverse_iterator)
+            bint operator<(reverse_iterator)
+            bint operator>(reverse_iterator)
             bint operator<=(reverse_iterator)
             bint operator>=(reverse_iterator)
         #cppclass const_iterator(iterator):