Replies: 1 comment 2 replies
-
When c++ lambda does not have return type specified and you return an lvalue, it defaults to return-by-value. You'd rather explicitly specify the return type instead: .def("__iadd__", [](array& a, const array& v) -> array& {
a += v;
return a;
}, "other"_a) |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
If you have a class bound via Pybin11, what's the right way to implemente inplace overloads so that the returned object is the same as the input object?
When checking the ids they are different
If that's not enough info to understand the issue, let me know i can provide a more complete example!
Beta Was this translation helpful? Give feedback.
All reactions