Skip to content

Commit 33fb533

Browse files
committed
fix: C++20 in Windows
Signed-off-by: Henry Schreiner <[email protected]> style: pre-commit fixes
1 parent bc557a9 commit 33fb533

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tests/test_pytypes.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1010,7 +1010,8 @@ TEST_SUBMODULE(pytypes, m) {
10101010

10111011
m.def("transform_tuple_plus_one", [](py::tuple &tpl) {
10121012
py::list ret{};
1013-
for (auto it : tpl | std::views::transform([](auto &o) { return py::cast<int>(o) + 1; })) {
1013+
for (auto &&it :
1014+
tpl | std::views::transform([](const auto &o) { return py::cast<int>(o) + 1; })) {
10141015
ret.append(py::int_(it));
10151016
}
10161017
return ret;
@@ -1025,7 +1026,8 @@ TEST_SUBMODULE(pytypes, m) {
10251026

10261027
m.def("transform_list_plus_one", [](py::list &lst) {
10271028
py::list ret{};
1028-
for (auto it : lst | std::views::transform([](auto &o) { return py::cast<int>(o) + 1; })) {
1029+
for (auto &&it :
1030+
lst | std::views::transform([](const auto &o) { return py::cast<int>(o) + 1; })) {
10291031
ret.append(py::int_(it));
10301032
}
10311033
return ret;

0 commit comments

Comments
 (0)