diff --git a/include/sqlpp11/detail/make_expression_tuple.h b/include/sqlpp11/detail/make_expression_tuple.h index 759209ac..0b9902c3 100644 --- a/include/sqlpp11/detail/make_expression_tuple.h +++ b/include/sqlpp11/detail/make_expression_tuple.h @@ -32,31 +32,38 @@ namespace sqlpp namespace detail { template - auto make_single_expression_tuple(Expr&& expr) -> typename std::enable_if::type>::value, decltype(std::make_tuple(expr))>::type + auto make_single_expression_tuple(Expr&& expr) + -> typename std::enable_if::type>::value, decltype(std::make_tuple(expr))>::type { return std::make_tuple(std::forward(expr)); }; template - auto make_single_expression_tuple(Expr&& expr) -> typename std::enable_if::type>::value, std::tuple<>>::type + auto make_single_expression_tuple(Expr&& expr) + -> typename std::enable_if::type>::value, std::tuple<>>::type { return {}; }; + /* template - auto make_single_expression_tuple(Tab&& tab) -> typename std::enable_if::type>::value, typename std::decay::type::_all_of_t>::type + auto make_single_expression_tuple(Tab&& tab) + -> typename std::enable_if::type>::value, typename std::decay::type::_all_of_t>::type { return {}; }; + */ template - auto make_single_expression_tuple(std::tuple&& t) -> std::tuple + auto make_single_expression_tuple(std::tuple&& t) + -> std::tuple { return t; }; template - auto make_expression_tuple(Expr&&... expr) -> decltype(std::tuple_cat(make_single_expression_tuple(std::forward(expr))...)) + auto make_expression_tuple(Expr&&... expr) + -> decltype(std::tuple_cat(make_single_expression_tuple(std::forward(expr))...)) { return std::tuple_cat(make_single_expression_tuple(std::forward(expr))...); }; diff --git a/tests/SelectTest.cpp b/tests/SelectTest.cpp index fe14b56e..f5ab0280 100644 --- a/tests/SelectTest.cpp +++ b/tests/SelectTest.cpp @@ -224,9 +224,9 @@ int main() { auto a = select(all_of(t)); auto b = select(t.alpha, t.beta, t.gamma); - auto c = select(t); + //auto c = select(t); static_assert(std::is_same::value, "all_of(t) has to be expanded by select()"); - static_assert(std::is_same::value, "t has to be expanded by select()"); + //static_assert(std::is_same::value, "t has to be expanded by select()"); } // Test that select(all_of(tab)) is expanded in multi_column @@ -238,7 +238,7 @@ int main() // Test that select(tab) is expanded in multi_column { - auto a = multi_column(sqlpp::alias::a, t); + auto a = multi_column(sqlpp::alias::a, all_of(t)); auto b = multi_column(sqlpp::alias::a, t.alpha, t.beta, t.gamma); static_assert(std::is_same::value, "t has to be expanded by multi_column"); } @@ -263,7 +263,7 @@ int main() } { - auto s = dynamic_select(db, t).dynamic_from().dynamic_where().dynamic_limit().dynamic_offset(); + auto s = dynamic_select(db, all_of(t)).dynamic_from().dynamic_where().dynamic_limit().dynamic_offset(); s = s.add_from(t); s = s.add_where(t.alpha > 7); s = s.set_limit(30);