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
f77650eb
Commit
f77650eb
authored
Aug 15, 2009
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Working stl vector example.
parent
2fe3ae06
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
1 deletion
+34
-1
Cython/Compiler/Symtab.py
Cython/Compiler/Symtab.py
+0
-1
tests/run/cpp_stl.pyx
tests/run/cpp_stl.pyx
+34
-0
No files found.
Cython/Compiler/Symtab.py
View file @
f77650eb
...
...
@@ -393,7 +393,6 @@ class Scope(object):
entry.type.scope = scope
self.type_entries.append(entry)
if not scope and not entry.type.scope:
print pos
self.check_for_illegal_incomplete_ctypedef(typedef_flag, pos)
return entry
...
...
tests/run/cpp_stl.pyx
0 → 100644
View file @
f77650eb
__doc__
=
u"""
>>> test_vector([1,10,100])
1
10
100
"""
cdef
extern
from
"vector"
namespace
std
:
cdef
cppclass
iterator
[
T
]:
pass
cdef
cppclass
vector
[
T
]:
#constructors
__init__
()
T
at
(
int
)
void
push_back
(
T
t
)
void
assign
(
int
,
T
)
void
clear
()
iterator
end
()
iterator
begin
()
int
size
()
def
test_vector
(
L
):
cdef
vector
[
int
]
*
V
=
new
vector
[
int
]()
for
a
in
L
:
V
.
push_back
(
a
)
cdef
int
i
for
i
in
range
(
len
(
L
)):
print
V
.
at
(
i
)
del
V
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