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
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
Show 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
# tag: cpp
from
libcpp.vector
cimport
vector
from
libcpp.vector
cimport
vector
from
cython.operator
cimport
dereference
as
deref
cdef
extern
from
"cpp_iterators_simple.h"
:
cdef
extern
from
"cpp_iterators_simple.h"
:
cdef
cppclass
DoublePointerIter
:
cdef
cppclass
DoublePointerIter
:
...
@@ -52,13 +53,13 @@ def test_custom():
...
@@ -52,13 +53,13 @@ def test_custom():
def
test_iteration_over_heap_vector
(
L
):
def
test_iteration_over_heap_vector
(
L
):
"""
"""
>>> test_iteration_over_heap_vector([1,2])
>>> test_iteration_over_heap_vector([1,2])
(1, 2)
[1, 2]
"""
"""
cdef
int
i
cdef
int
i
cdef
vector
[
int
]
*
vint
=
new
vector
[
int
]()
cdef
vector
[
int
]
*
vint
=
new
vector
[
int
]()
try
:
try
:
for
i
in
L
:
for
i
in
L
:
vint
.
push_back
(
i
)
vint
.
push_back
(
i
)
return
[
i
for
i
in
vint
]
return
[
i
for
i
in
deref
(
vint
)
]
finally
:
finally
:
del
vint
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