From 6cdd24b05aa5047a8ae5270c391ca91597f67070 Mon Sep 17 00:00:00 2001 From: Lisandro Dalcin Date: Wed, 6 Oct 2010 19:46:12 -0300 Subject: [PATCH] fixes and enhancements in libcpp --- Cython/Includes/libcpp/deque.pxd | 4 ++-- Cython/Includes/libcpp/list.pxd | 5 +++-- Cython/Includes/libcpp/map.pxd | 8 ++++---- Cython/Includes/libcpp/pair.pxd | 8 +------- Cython/Includes/libcpp/set.pxd | 8 ++++---- Cython/Includes/libcpp/utility.pxd | 13 +++++++++++++ Cython/Includes/libcpp/vector.pxd | 8 ++++---- 7 files changed, 31 insertions(+), 23 deletions(-) create mode 100644 Cython/Includes/libcpp/utility.pxd diff --git a/Cython/Includes/libcpp/deque.pxd b/Cython/Includes/libcpp/deque.pxd index fc0a4913..62965ae5 100644 --- a/Cython/Includes/libcpp/deque.pxd +++ b/Cython/Includes/libcpp/deque.pxd @@ -12,8 +12,8 @@ cdef extern from "" 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): diff --git a/Cython/Includes/libcpp/list.pxd b/Cython/Includes/libcpp/list.pxd index b395f7d6..0b6eb1dc 100644 --- a/Cython/Includes/libcpp/list.pxd +++ b/Cython/Includes/libcpp/list.pxd @@ -10,8 +10,8 @@ cdef extern from "" 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 "" namespace "std": T& back() iterator begin() #const_iterator begin() + void clear() bint empty() iterator end() #const_iterator end() diff --git a/Cython/Includes/libcpp/map.pxd b/Cython/Includes/libcpp/map.pxd index 78c8cd99..4768a54d 100644 --- a/Cython/Includes/libcpp/map.pxd +++ b/Cython/Includes/libcpp/map.pxd @@ -1,4 +1,4 @@ -from pair cimport pair +from utility cimport pair cdef extern from "" namespace "std": cdef cppclass map[T, U]: @@ -9,11 +9,11 @@ cdef extern from "" 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): diff --git a/Cython/Includes/libcpp/pair.pxd b/Cython/Includes/libcpp/pair.pxd index da0eb773..0915eee3 100644 --- a/Cython/Includes/libcpp/pair.pxd +++ b/Cython/Includes/libcpp/pair.pxd @@ -1,7 +1 @@ -cdef extern from "" namespace "std": - cdef cppclass pair[T, U]: - T first - U second - pair() - pair(pair&) - pair(T&, U&) +from utility cimport pair diff --git a/Cython/Includes/libcpp/set.pxd b/Cython/Includes/libcpp/set.pxd index 6d6607ee..89a6f557 100644 --- a/Cython/Includes/libcpp/set.pxd +++ b/Cython/Includes/libcpp/set.pxd @@ -3,17 +3,17 @@ from pair cimport pair cdef extern from "" 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 index 00000000..1d8ead78 --- /dev/null +++ b/Cython/Includes/libcpp/utility.pxd @@ -0,0 +1,13 @@ +cdef extern from "" 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&) diff --git a/Cython/Includes/libcpp/vector.pxd b/Cython/Includes/libcpp/vector.pxd index 61c6aefb..0ec55702 100644 --- a/Cython/Includes/libcpp/vector.pxd +++ b/Cython/Includes/libcpp/vector.pxd @@ -6,8 +6,8 @@ cdef extern from "" 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 "" 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): -- 2.26.2