File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -1010,7 +1010,7 @@ TEST_SUBMODULE(pytypes, m) {
1010
1010
1011
1011
m.def (" transform_tuple_plus_one" , [](py::tuple &tpl) {
1012
1012
py::list ret{};
1013
- for (auto it : tpl | std::views::transform ([](auto &o) { return py::cast<int >(o) + 1 ; })) {
1013
+ for (auto && it : tpl | std::views::transform ([](const auto &o) { return py::cast<int >(o) + 1 ; })) {
1014
1014
ret.append (py::int_ (it));
1015
1015
}
1016
1016
return ret;
@@ -1025,7 +1025,7 @@ TEST_SUBMODULE(pytypes, m) {
1025
1025
1026
1026
m.def (" transform_list_plus_one" , [](py::list &lst) {
1027
1027
py::list ret{};
1028
- for (auto it : lst | std::views::transform ([](auto &o) { return py::cast<int >(o) + 1 ; })) {
1028
+ for (auto && it : lst | std::views::transform ([](const auto &o) { return py::cast<int >(o) + 1 ; })) {
1029
1029
ret.append (py::int_ (it));
1030
1030
}
1031
1031
return ret;
You can’t perform that action at this time.
0 commit comments