-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrapping "friend" operators without py::self shortcuts #3
Comments
Hmm... Can you show a MWE (minimum working example) of this in a standalone C++ program? |
Here's basic operator overloading + refs in namespace: |
And here's it breaking (for g++ and clang++) if operator decl+def moves into a So at least it's nothing special to Drake? |
@EricCousineau-TRI, it does now! Correct, I do not believe it's drake specific. But PyBind11, or maybe AutoPyBind11, aren't happy with I know about issue 130. I created it to have something to point to for our timing system when working on this particular issue. As for the MWE, I've pushed a commit to my fork of autopybind here: https://gitlab.kitware.com/joe-snyder/autopybind11/-/commit/0117429a99d299312d4aa35a8971ad17677a36a5 This shows the operator+ problem when running. I've also included the autopybind output file named I'm working on getting the operator<< one to error in a minimal way. |
Copying email thread: From @bradking:
Follow-up on my part:
Follow-up on my part:
|
Closing per GitLab issue: https://gitlab.kitware.com/autopybind11/autopybind11/-/issues/130 |
When trying to wrap the polynomial class, we receive a variety of errors with the direct generation of the pybind11 code.
Wrapping
drake::Polynomial<double> const drake::operator+(double const & scalar, drake::Polynomial<double> const & p) [free operator]
which points to this function: https://github.com/RobotLocomotion/drake/blob/master/common/polynomial.h#L341returns
Additionally, "operator<<" returns a slightly different error:
The text was updated successfully, but these errors were encountered: