Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
cython
Commits
a4da52aa
Commit
a4da52aa
authored
Feb 02, 2017
by
Joe Jevnik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add size_type and difference_type to vector and update insert calls to return
interator (true as of C++11)
parent
68336b38
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
20 deletions
+27
-20
Cython/Includes/libcpp/vector.pxd
Cython/Includes/libcpp/vector.pxd
+27
-20
No files found.
Cython/Includes/libcpp/vector.pxd
View file @
a4da52aa
...
@@ -2,13 +2,20 @@ cdef extern from "<vector>" namespace "std" nogil:
...
@@ -2,13 +2,20 @@ cdef extern from "<vector>" namespace "std" nogil:
cdef
cppclass
vector
[
T
,
ALLOCATOR
=*
]:
cdef
cppclass
vector
[
T
,
ALLOCATOR
=*
]:
ctypedef
T
value_type
ctypedef
T
value_type
ctypedef
ALLOCATOR
allocator_type
ctypedef
ALLOCATOR
allocator_type
# these should really be allocator_type.size_type and
# allocator_type.difference_type to be true to the C++ definition
# but cython doesn't support defered access on template arguments
ctypedef
size_t
size_type
ctypedef
ptrdiff_t
difference_type
cppclass
iterator
:
cppclass
iterator
:
T
&
operator
*
()
T
&
operator
*
()
iterator
operator
++
()
iterator
operator
++
()
iterator
operator
--
()
iterator
operator
--
()
iterator
operator
+
(
size_t
)
iterator
operator
+
(
size_t
ype
)
iterator
operator
-
(
size_t
)
iterator
operator
-
(
size_t
ype
)
size_t
operator
-
(
iterator
)
difference_type
operator
-
(
iterator
)
bint
operator
==
(
iterator
)
bint
operator
==
(
iterator
)
bint
operator
!=
(
iterator
)
bint
operator
!=
(
iterator
)
bint
operator
<
(
iterator
)
bint
operator
<
(
iterator
)
...
@@ -19,8 +26,8 @@ cdef extern from "<vector>" namespace "std" nogil:
...
@@ -19,8 +26,8 @@ cdef extern from "<vector>" namespace "std" nogil:
T
&
operator
*
()
T
&
operator
*
()
iterator
operator
++
()
iterator
operator
++
()
iterator
operator
--
()
iterator
operator
--
()
iterator
operator
+
(
size_t
)
iterator
operator
+
(
size_t
ype
)
iterator
operator
-
(
size_t
)
iterator
operator
-
(
size_t
ype
)
bint
operator
==
(
reverse_iterator
)
bint
operator
==
(
reverse_iterator
)
bint
operator
!=
(
reverse_iterator
)
bint
operator
!=
(
reverse_iterator
)
bint
operator
<
(
reverse_iterator
)
bint
operator
<
(
reverse_iterator
)
...
@@ -33,10 +40,10 @@ cdef extern from "<vector>" namespace "std" nogil:
...
@@ -33,10 +40,10 @@ cdef extern from "<vector>" namespace "std" nogil:
pass
pass
vector
()
except
+
vector
()
except
+
vector
(
vector
&
)
except
+
vector
(
vector
&
)
except
+
vector
(
size_t
)
except
+
vector
(
size_t
ype
)
except
+
vector
(
size_t
,
T
&
)
except
+
vector
(
size_t
ype
,
T
&
)
except
+
#vector[input_iterator](input_iterator, input_iterator)
#vector[input_iterator](input_iterator, input_iterator)
T
&
operator
[](
size_t
)
T
&
operator
[](
size_t
ype
)
#vector& operator=(vector&)
#vector& operator=(vector&)
bint
operator
==
(
vector
&
,
vector
&
)
bint
operator
==
(
vector
&
,
vector
&
)
bint
operator
!=
(
vector
&
,
vector
&
)
bint
operator
!=
(
vector
&
,
vector
&
)
...
@@ -44,13 +51,13 @@ cdef extern from "<vector>" namespace "std" nogil:
...
@@ -44,13 +51,13 @@ cdef extern from "<vector>" namespace "std" nogil:
bint
operator
>
(
vector
&
,
vector
&
)
bint
operator
>
(
vector
&
,
vector
&
)
bint
operator
<=
(
vector
&
,
vector
&
)
bint
operator
<=
(
vector
&
,
vector
&
)
bint
operator
>=
(
vector
&
,
vector
&
)
bint
operator
>=
(
vector
&
,
vector
&
)
void
assign
(
size_t
,
const
T
&
)
void
assign
(
size_t
ype
,
const
T
&
)
void
assign
[
input_iterator
](
input_iterator
,
input_iterator
)
except
+
void
assign
[
input_iterator
](
input_iterator
,
input_iterator
)
except
+
T
&
at
(
size_t
)
except
+
T
&
at
(
size_t
ype
)
except
+
T
&
back
()
T
&
back
()
iterator
begin
()
iterator
begin
()
const_iterator
const_begin
"begin"
()
const_iterator
const_begin
"begin"
()
size_t
capacity
()
size_t
ype
capacity
()
void
clear
()
void
clear
()
bint
empty
()
bint
empty
()
iterator
end
()
iterator
end
()
...
@@ -59,19 +66,19 @@ cdef extern from "<vector>" namespace "std" nogil:
...
@@ -59,19 +66,19 @@ cdef extern from "<vector>" namespace "std" nogil:
iterator
erase
(
iterator
,
iterator
)
iterator
erase
(
iterator
,
iterator
)
T
&
front
()
T
&
front
()
iterator
insert
(
iterator
,
const
T
&
)
except
+
iterator
insert
(
iterator
,
const
T
&
)
except
+
void
insert
(
iterator
,
size_t
,
const
T
&
)
except
+
iterator
insert
(
iterator
,
size_type
,
const
T
&
)
except
+
void
insert
[
Iter
](
iterator
,
Iter
,
Iter
)
except
+
iterator
insert
[
Iter
](
iterator
,
Iter
,
Iter
)
except
+
size_t
max_size
()
size_t
ype
max_size
()
void
pop_back
()
void
pop_back
()
void
push_back
(
T
&
)
except
+
void
push_back
(
T
&
)
except
+
reverse_iterator
rbegin
()
reverse_iterator
rbegin
()
const_reverse_iterator
const_rbegin
"rbegin"
()
const_reverse_iterator
const_rbegin
"
c
rbegin"
()
reverse_iterator
rend
()
reverse_iterator
rend
()
const_reverse_iterator
const_rend
"rend"
()
const_reverse_iterator
const_rend
"
c
rend"
()
void
reserve
(
size_t
)
void
reserve
(
size_t
ype
)
void
resize
(
size_t
)
except
+
void
resize
(
size_t
ype
)
except
+
void
resize
(
size_t
,
T
&
)
except
+
void
resize
(
size_t
ype
,
T
&
)
except
+
size_t
size
()
size_t
ype
size
()
void
swap
(
vector
&
)
void
swap
(
vector
&
)
# C++11 methods
# C++11 methods
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment