33 * @ingroup SQLiteCpp
44 * @brief Convenience function to execute a Statement with multiple Parameter sets
55 *
6- * Copyright (c) 2019 Maximilian Bachmann (github maxbachmann)
6+ * Copyright (c) 2019 Maximilian Bachmann (contact@ maxbachmann.de )
77 * Copyright (c) 2019 Sebastien Rombauts ([email protected] ) 88 *
99 * Distributed under the MIT License (MIT) (See accompanying file LICENSE.txt
@@ -33,8 +33,8 @@ namespace SQLite
3333 *
3434 * \code{.cpp}
3535 * execute_many(db, "INSERT INTO test VALUES (?, ?)",
36- * std::make_tuple(1, "one") ,
37- * std::make_tuple(2, "two" ),
36+ * 1 ,
37+ * std::make_tuple(2),
3838 * std::make_tuple(3, "three")
3939 * );
4040 * \endcode
@@ -47,10 +47,10 @@ template <typename Arg, typename... Types>
4747void execute_many (Database& aDatabase, const char * apQuery, Arg&& aArg, Types&&... aParams)
4848{
4949 SQLite::Statement query (aDatabase, apQuery);
50- bind_exec (query, std::forward<decltype (aArg) >(aArg));
50+ bind_exec (query, std::forward<Arg >(aArg));
5151 (void )std::initializer_list<int >
5252 {
53- ((void )reset_bind_exec (query, std::forward<decltype (aParams) >(aParams)), 0 )...
53+ ((void )reset_bind_exec (query, std::forward<Types >(aParams)), 0 )...
5454 };
5555}
5656
@@ -63,11 +63,11 @@ void execute_many(Database& aDatabase, const char* apQuery, Arg&& aArg, Types&&.
6363 * @param apQuery Query to use
6464 * @param aTuple Tuple to bind
6565 */
66- template <typename ... Types >
67- void reset_bind_exec (SQLite:: Statement& apQuery, std::tuple<Types...> && aTuple)
66+ template <typename TupleT >
67+ void reset_bind_exec (Statement& apQuery, TupleT && aTuple)
6868{
6969 apQuery.reset ();
70- bind_exec (apQuery, std::forward<decltype (aTuple) >(aTuple));
70+ bind_exec (apQuery, std::forward<TupleT >(aTuple));
7171}
7272
7373/* *
@@ -78,10 +78,10 @@ void reset_bind_exec(SQLite::Statement& apQuery, std::tuple<Types...>&& aTuple)
7878 * @param apQuery Query to use
7979 * @param aTuple Tuple to bind
8080 */
81- template <typename ... Types >
82- void bind_exec (SQLite:: Statement& apQuery, std::tuple<Types...> && aTuple)
81+ template <typename TupleT >
82+ void bind_exec (Statement& apQuery, TupleT && aTuple)
8383{
84- bind (apQuery, std::forward<decltype (aTuple) >(aTuple));
84+ SQLite:: bind (apQuery, std::forward<TupleT >(aTuple));
8585 while (apQuery.executeStep ()) {}
8686}
8787
0 commit comments