From 548a60102689abaf8786f746d2a11f2f15d20985 Mon Sep 17 00:00:00 2001 From: rbock Date: Sun, 9 Nov 2014 13:00:17 +0100 Subject: [PATCH] Added into() free function --- include/sqlpp11/into.h | 6 ++++++ tests/CustomQueryTest.cpp | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/include/sqlpp11/into.h b/include/sqlpp11/into.h index cff8fb35..e1d2ddd5 100644 --- a/include/sqlpp11/into.h +++ b/include/sqlpp11/into.h @@ -27,6 +27,7 @@ #ifndef SQLPP_INTO_H #define SQLPP_INTO_H +#include #include #include #include @@ -168,6 +169,11 @@ namespace sqlpp } }; + template + auto into(T&&... t) -> decltype(statement_t().into(std::forward(t)...)) + { + return statement_t().into(std::forward(t)...); + } } #endif diff --git a/tests/CustomQueryTest.cpp b/tests/CustomQueryTest.cpp index 61b358e5..b5635f37 100644 --- a/tests/CustomQueryTest.cpp +++ b/tests/CustomQueryTest.cpp @@ -37,7 +37,7 @@ int main() test::TabFoo f; test::TabBar t; - auto c = custom_query(select(all_of(t)).from(t), sqlpp::verbatim("INTO"), f); + auto c = custom_query(select(all_of(t)).from(t), into(f)); std::cerr << serialize(c, printer).str() << std::endl; db(c);