@@ -128,7 +128,7 @@ namespace cpp_redis {
128128 }
129129
130130 template <typename F, typename ...Ts, std::size_t ...Is>
131- void for_each_tuple_front (const std::tuple<Ts...>& tuple, F func, cpp_redis::traits::index_sequence<Is...>) {
131+ void for_each_tuple_front (std::tuple<Ts...>&& tuple, F&& func, cpp_redis::traits::index_sequence<Is...>) {
132132 constexpr auto SIZE = std::tuple_size<cpp_redis::traits::remove_reference_t <decltype (tuple)>>::value;
133133#if (_MSC_VER >= 1700 && _MSC_VER <= 1900) // vs2012-vs2015
134134 if (constexpr (SIZE > 0 )) {
@@ -155,12 +155,12 @@ namespace cpp_redis {
155155 }
156156
157157 template <typename F, typename ...Ts>
158- void for_each_tuple_front (const std::tuple<Ts...>& tuple, F&& func) {
159- for_each_tuple_front (tuple, func, cpp_redis::traits::make_index_sequence<sizeof ...(Ts)>());
158+ void for_each_tuple_front (std::tuple<Ts...>& & tuple, F&& func) {
159+ for_each_tuple_front (std::forward<std:: tuple<Ts...>>(tuple) , func, cpp_redis::traits::make_index_sequence<sizeof ...(Ts)>());
160160 }
161161
162162 template <typename F, typename ...Ts, std::size_t ...Is>
163- void for_each_tuple_back (const std::tuple<Ts...>& tuple, F func, cpp_redis::traits::index_sequence<Is...>) {
163+ void for_each_tuple_back (std::tuple<Ts...>&& tuple, F&& func, cpp_redis::traits::index_sequence<Is...>) {
164164 // 匿名构造函数调用
165165 constexpr auto SIZE = std::tuple_size<cpp_redis::traits::remove_reference_t <decltype (tuple)>>::value;
166166#if (_MSC_VER >= 1700 && _MSC_VER <= 1900) // vs2012-vs2015
@@ -181,8 +181,8 @@ namespace cpp_redis {
181181 }
182182
183183 template <typename F, typename ...Ts>
184- void for_each_tuple_back (std::tuple<Ts...>& tuple, F&& func) {
185- for_each_tuple_back (tuple, func, cpp_redis::traits::make_index_sequence<sizeof ...(Ts)>());
184+ void for_each_tuple_back (std::tuple<Ts...>&& tuple, F&& func) {
185+ for_each_tuple_back (std::forward<std:: tuple<Ts...>>(tuple) , func, cpp_redis::traits::make_index_sequence<sizeof ...(Ts)>());
186186 }
187187 }
188188}
0 commit comments