pybind11 C++ Output Redirection to Python with Derived Class #5014
Unanswered
pa-beaufort
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello every1,
I'd like to expose a pure virtual class with a member method that deals with
std::ostream&
arguments:I have another class that collects objects in a vector derived from this pure virtual class and calls the method dealing with
std::ostream&
for all collected objects:If I derive the pure virtual class in Python by implementing the member method and then add this object to the collecting class and call the goall method, it fails - while calling go for this derived class works:
How can I fix the error?
The whole demo is provided below.
I can provide further information if requested :-)
Thanks for your time and help.
animals.cpp
test.py
Beta Was this translation helpful? Give feedback.
All reactions