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
b757adc9
Commit
b757adc9
authored
Aug 11, 2012
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix template types as class members.
parent
03ed3abc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
1 deletion
+12
-1
Cython/Compiler/ModuleNode.py
Cython/Compiler/ModuleNode.py
+1
-1
tests/run/cpp_stl.pyx
tests/run/cpp_stl.pyx
+11
-0
No files found.
Cython/Compiler/ModuleNode.py
View file @
b757adc9
...
@@ -1036,7 +1036,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
...
@@ -1036,7 +1036,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
for
entry
in
cpp_class_attrs
:
for
entry
in
cpp_class_attrs
:
code
.
putln
(
"new((void*)&(p->%s)) %s();"
%
code
.
putln
(
"new((void*)&(p->%s)) %s();"
%
(
entry
.
cname
,
entry
.
type
.
cname
));
(
entry
.
cname
,
entry
.
type
.
declaration_code
(
""
)
));
for
entry
in
py_attrs
:
for
entry
in
py_attrs
:
if
scope
.
is_internal
or
entry
.
name
==
"__weakref__"
:
if
scope
.
is_internal
or
entry
.
name
==
"__weakref__"
:
...
...
tests/run/cpp_stl.pyx
View file @
b757adc9
...
@@ -52,3 +52,14 @@ def test_vector_iterator(L):
...
@@ -52,3 +52,14 @@ def test_vector_iterator(L):
print
deref
(
iter
)
print
deref
(
iter
)
inc
(
iter
)
inc
(
iter
)
del
v
del
v
cdef
class
VectorWrapper
:
"""
>>> VectorWrapper(1, .5, .25, .125)
[1.0, 0.5, 0.25, 0.125]
"""
cdef
vector
[
double
]
vector
def
__init__
(
self
,
*
args
):
self
.
vector
=
args
def
__repr__
(
self
):
return
repr
(
self
.
vector
)
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