mirror of
https://github.com/pybind/pybind11.git
synced 2025-01-20 18:02:36 +00:00
2bab5793f7
`auto var = l[0]` has a strange quirk: `var` is actually an accessor and not an object, so any later assignment of `var = ...` would modify l[0] instead of `var`. This is surprising compared to the non-auto assignment `py::object var = l[0]; var = ...`. By overloading `operator=` on lvalue/rvalue, the expected behavior is restored even for `auto` variables. |
||
---|---|---|
.. | ||
attr.h | ||
cast.h | ||
common.h | ||
complex.h | ||
descr.h | ||
eigen.h | ||
eval.h | ||
functional.h | ||
numpy.h | ||
operators.h | ||
pybind11.h | ||
pytypes.h | ||
stl_bind.h | ||
stl.h | ||
typeid.h |