Mike Graham
Mike Graham

Reputation: 76753

How do I use a base class constructor for a cppclass in Cython?

Suppose I have

cdef extern from "foo.h":
    cppclass Base:
        Base(int i)  # only constructor

cdef cppclass Child(Base):
    __init__():
        pass

How do I make sure that Base(int) is called? The generated C++ for Child needs to initialize Base in its constructor's initializer list; can I do that with Cython?

Upvotes: 0

Views: 69

Answers (1)

DavidW
DavidW

Reputation: 30917

I don't think it's currently possible.

The ability to define C++ classes within Cython (as opposed to wrapping existing C++ classes) is currently somewhat underdeveloped and undocumented (largely because there's a lot that you can't do).

Upvotes: 1

Related Questions