diff --git a/include/pybind11/pybind11.h b/include/pybind11/pybind11.h index 25ca508abd..4c0069bfb4 100644 --- a/include/pybind11/pybind11.h +++ b/include/pybind11/pybind11.h @@ -1142,7 +1142,7 @@ class cpp_function : public function { } msg += "kwargs: "; bool first = true; - for (auto kwarg : kwargs) { + for (const auto &kwarg : kwargs) { if (first) { first = false; } else {