From e3aa215b020886d648add951186052c619c3cf9d Mon Sep 17 00:00:00 2001 From: Aaron Gokaslan Date: Mon, 11 Apr 2022 14:03:43 -0400 Subject: [PATCH] Add perfect forwarding to make_iterator calls (#3860) --- 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 797c769d7..97275e40a 100644 --- a/include/pybind11/pybind11.h +++ b/include/pybind11/pybind11.h @@ -2403,7 +2403,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 @@ -2412,7 +2413,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 @@ -2421,7 +2423,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