From a9fb634fa1bb8e5739aa148d0a9be06042612d62 Mon Sep 17 00:00:00 2001 From: Aaron Gokaslan Date: Mon, 11 Apr 2022 13:15:49 -0400 Subject: [PATCH] Add perfect forwarding to make_iterators --- include/pybind11/pybind11.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/include/pybind11/pybind11.h b/include/pybind11/pybind11.h index fa018b509d..e6df571cd9 100644 --- a/include/pybind11/pybind11.h +++ b/include/pybind11/pybind11.h @@ -2402,7 +2402,8 @@ template iterator make_iterator(Type &value, Extra &&...extra) { - return make_iterator(std::begin(value), std::end(value), extra...); + return make_iterator( + std::begin(value), std::end(value), std::forward(extra)...); } /// Makes an iterator over the keys (`.first`) of a stl map-like container supporting @@ -2411,7 +2412,8 @@ template iterator make_key_iterator(Type &value, Extra &&...extra) { - return make_key_iterator(std::begin(value), std::end(value), extra...); + return make_key_iterator( + std::begin(value), std::end(value), std::forward(extra)...); } /// Makes an iterator over the values (`.second`) of a stl map-like container supporting @@ -2420,7 +2422,8 @@ template iterator make_value_iterator(Type &value, Extra &&...extra) { - return make_value_iterator(std::begin(value), std::end(value), extra...); + return make_value_iterator( + std::begin(value), std::end(value), std::forward(extra)...); } template