-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
[BUG]: error: lvalue required as increment operand #4100
Comments
@hiaselhans Does this code snippit work with pybind11 2.9? |
Hello, Don't know if it helps but the code above compiles fine replacing: return py::make_iterator(v.values, v.values + 3); with: return py::make_iterator(v.values); (wich will then look for begin and end of v.values which is of type return py::make_iterator(static_cast<const double*>(v.values), v.values + 3); or: return py::make_iterator(&(v.values[0]), &(v.values[0]) + 3); to select th right overloaded function. |
It seems that the introduction of forwarding reference in 2.10.0 for: iterator make_iterator(Iterator &&first, Sentinel &&last, Extra &&...extra) tends to favor the selection of: iterator make_iterator(Type &value, Extra &&...extra) which leads to the "bug" above. |
Could #4105 be related to this ? |
Not me, but the regressions others found I listed in #4125. The regression for me has been the scikit_build_example one, which I need to work out before a release. The overload one is likely similar. |
I think it's almost certainly a different kind of breakage. |
This one? https://github.com/pybind/pybind11/pull/3860/files Sounds good to me: I'm unable to foresee the side-effects one way or another (so many details come into play), but the older version is time-tested. Including something like the test in the PR description here with the rollback seems important. |
I was just asking because I had runtime errors due to this very change. I did not investigate much further. :-/ |
Required prerequisites
Problem description
previously compiling code fails with gcc 12.1.0:
relevant code:
pybind11/include/pybind11/pybind11.h
Lines 2336 to 2360 in 1e3400b
Reproducible example code
The text was updated successfully, but these errors were encountered: