Commit b757adc9 authored by Robert Bradshaw's avatar Robert Bradshaw

Fix template types as class members.

parent 03ed3abc
......@@ -1036,7 +1036,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
for entry in cpp_class_attrs:
code.putln("new((void*)&(p->%s)) %s();" %
(entry.cname, entry.type.cname));
(entry.cname, entry.type.declaration_code("")));
for entry in py_attrs:
if scope.is_internal or entry.name == "__weakref__":
......
......@@ -52,3 +52,14 @@ def test_vector_iterator(L):
print deref(iter)
inc(iter)
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)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment