@@ -180,7 +180,7 @@ class pg_conn_t
180180 * status code PGRES_COMMAND_OK or PGRES_TUPLES_OK).
181181 */
182182 template <typename ... TArgs>
183- pg_result_t exec (fmt::format_string<TArgs...> sql, TArgs... params) const
183+ pg_result_t exec (fmt::format_string<TArgs...> sql, TArgs && ...params) const
184184 {
185185 return exec (fmt::format (sql, std::forward<TArgs>(params)...));
186186 }
@@ -196,7 +196,7 @@ class pg_conn_t
196196 */
197197 template <typename ... TArgs>
198198 void prepare (std::string const &stmt, fmt::format_string<TArgs...> sql,
199- TArgs... params) const
199+ TArgs && ...params) const
200200 {
201201 std::string const query =
202202 fmt::format (sql, std::forward<TArgs>(params)...);
@@ -213,7 +213,7 @@ class pg_conn_t
213213 * \throws exception if the command failed.
214214 */
215215 template <typename ... TArgs>
216- pg_result_t exec_prepared (char const *stmt, TArgs... params) const
216+ pg_result_t exec_prepared (char const *stmt, TArgs && ...params) const
217217 {
218218 return exec_prepared_with_result_format (stmt, false ,
219219 std::forward<TArgs>(params)...);
@@ -229,7 +229,8 @@ class pg_conn_t
229229 * \throws exception if the command failed.
230230 */
231231 template <typename ... TArgs>
232- pg_result_t exec_prepared_as_binary (char const *stmt, TArgs... params) const
232+ pg_result_t exec_prepared_as_binary (char const *stmt,
233+ TArgs &&...params) const
233234 {
234235 return exec_prepared_with_result_format (stmt, true ,
235236 std::forward<TArgs>(params)...);
@@ -312,7 +313,7 @@ class pg_conn_t
312313 template <typename ... TArgs>
313314 pg_result_t exec_prepared_with_result_format (char const *stmt,
314315 bool result_as_binary,
315- TArgs... params) const
316+ TArgs && ...params) const
316317 {
317318 // We have to convert all non-string parameters into strings and
318319 // store them somewhere. We use the exec_params vector for this.
0 commit comments