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
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
03ed3abc
Commit
03ed3abc
authored
Aug 11, 2012
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix cpp iterator test.
parent
d0a8e247
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
tests/run/cpp_iterators.pyx
tests/run/cpp_iterators.pyx
+3
-2
No files found.
tests/run/cpp_iterators.pyx
View file @
03ed3abc
# tag: cpp
from
libcpp.vector
cimport
vector
from
cython.operator
cimport
dereference
as
deref
cdef
extern
from
"cpp_iterators_simple.h"
:
cdef
cppclass
DoublePointerIter
:
...
...
@@ -52,13 +53,13 @@ def test_custom():
def
test_iteration_over_heap_vector
(
L
):
"""
>>> test_iteration_over_heap_vector([1,2])
(1, 2)
[1, 2]
"""
cdef
int
i
cdef
vector
[
int
]
*
vint
=
new
vector
[
int
]()
try
:
for
i
in
L
:
vint
.
push_back
(
i
)
return
[
i
for
i
in
vint
]
return
[
i
for
i
in
deref
(
vint
)
]
finally
:
del
vint
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