Open
Description
This does not compile on GCC 5.4:
py::list out(1);
auto it = out.begin();
*it = py::cast(0); // fails to compile
These other statements are OK:
out[0] = py::cast(0); // works OK
out.append(py::cast(0)); // works OK
The error message indicates that *it is const. I guess it's related to this:
using list_iterator = generic_iterator<iterator_policies::sequence_fast_readonly>;
To me this is a bug, either in the documentation or in the code. Is there a specific reason for these iterators to be read-only? Am I supposed to create lists by appending elements one by one?
Metadata
Metadata
Assignees
Labels
No labels