0
0
mirror of https://github.com/rbock/sqlpp11.git synced 2024-11-16 04:47:18 +08:00

Added into() free function

This commit is contained in:
rbock 2014-11-09 13:00:17 +01:00
parent ba1f200ef1
commit 548a601026
2 changed files with 7 additions and 1 deletions

View File

@ -27,6 +27,7 @@
#ifndef SQLPP_INTO_H #ifndef SQLPP_INTO_H
#define SQLPP_INTO_H #define SQLPP_INTO_H
#include <sqlpp11/statement_fwd.h>
#include <sqlpp11/type_traits.h> #include <sqlpp11/type_traits.h>
#include <sqlpp11/no_value.h> #include <sqlpp11/no_value.h>
#include <sqlpp11/no_data.h> #include <sqlpp11/no_data.h>
@ -168,6 +169,11 @@ namespace sqlpp
} }
}; };
template<typename... T>
auto into(T&&... t) -> decltype(statement_t<void, no_into_t>().into(std::forward<T>(t)...))
{
return statement_t<void, no_into_t>().into(std::forward<T>(t)...);
}
} }
#endif #endif

View File

@ -37,7 +37,7 @@ int main()
test::TabFoo f; test::TabFoo f;
test::TabBar t; 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; std::cerr << serialize(c, printer).str() << std::endl;
db(c); db(c);