Support stack-allocation with initialization values #1694

Open
ferdonline opened this Issue May 3, 2017 · 0 comments

Comments

Projects
None yet
1 participant

At the moment it is only possible to stack-allocate C++ objects using the default constructor.
It would be very interesting to allow creating objects on the stack using another constructor.
E.g.

cdef extern from ...
     cdef cppclass Foo:
         Foo(int a)

# possible syntax
cdef myfunc():
     # Clean but verbose
     cdef Foo var = Foo(123)

     # Short, C++ style
     cdef Foo var(123)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment