Skip to content

Commit ade848d

Browse files
authored
Merge pull request #1871 from joto/refactor-use-fold-expression
Refactor: Use fold expression for add_columns() function
2 parents e35cb57 + 59b70d1 commit ade848d

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

src/db-copy-mgr.hpp

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -80,17 +80,10 @@ class db_copy_mgr_t
8080
*
8181
* See add_column().
8282
*/
83-
template <typename T, typename... ARGS>
84-
void add_columns(T value, ARGS &&... args)
85-
{
86-
add_column(value);
87-
add_columns(std::forward<ARGS>(args)...);
88-
}
89-
90-
template <typename T>
91-
void add_columns(T value)
83+
template <typename... ARGS>
84+
void add_columns(ARGS &&...args)
9285
{
93-
add_column(value);
86+
(add_column(std::forward<ARGS>(args)), ...);
9487
}
9588

9689
/**

0 commit comments

Comments
 (0)