From 0807e579587dbbccbc9111a2dbe1d3edb2d792f2 Mon Sep 17 00:00:00 2001 From: rbock Date: Sat, 30 May 2015 16:45:06 +0200 Subject: [PATCH] Fixed warnings about missing initializers --- include/sqlpp11/join.h | 12 ++++++------ include/sqlpp11/table.h | 10 +++++----- tests/Select.cpp | 6 ++++++ 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/include/sqlpp11/join.h b/include/sqlpp11/join.h index 8e2578d6..105e4873 100644 --- a/include/sqlpp11/join.h +++ b/include/sqlpp11/join.h @@ -90,7 +90,7 @@ namespace sqlpp return { _lhs, _rhs, - {std::tuple{expr...}} + {std::tuple{expr...}, {}} }; } @@ -98,35 +98,35 @@ namespace sqlpp join_t join(T t) { static_assert(not is_noop::value, "join type requires on()"); - return { *this, t }; + return { *this, t, {} }; } template join_t inner_join(T t) { static_assert(not is_noop::value, "join type requires on()"); - return { *this, t }; + return { *this, t, {} }; } template join_t outer_join(T t) { static_assert(not is_noop::value, "join type requires on()"); - return { *this, t }; + return { *this, t, {} }; } template join_t left_outer_join(T t) { static_assert(not is_noop::value, "join type requires on()"); - return { *this, t }; + return { *this, t, {} }; } template join_t right_outer_join(T t) { static_assert(not is_noop::value, "join type requires on()"); - return { *this, t }; + return { *this, t, {} }; } Lhs _lhs; diff --git a/include/sqlpp11/table.h b/include/sqlpp11/table.h index 26b14e0c..cb053ade 100644 --- a/include/sqlpp11/table.h +++ b/include/sqlpp11/table.h @@ -60,31 +60,31 @@ namespace sqlpp template join_t join(T t) const { - return { *static_cast(this), t }; + return { *static_cast(this), t, {} }; } template join_t inner_join(T t) const { - return { *static_cast(this), t }; + return { *static_cast(this), t, {} }; } template join_t outer_join(T t) const { - return { *static_cast(this), t }; + return { *static_cast(this), t, {} }; } template join_t left_outer_join(T t) const { - return { *static_cast(this), t }; + return { *static_cast(this), t, {} }; } template join_t right_outer_join(T t) const { - return { *static_cast(this), t }; + return { *static_cast(this), t, {} }; } template diff --git a/tests/Select.cpp b/tests/Select.cpp index 460a85b3..1762a47e 100644 --- a/tests/Select.cpp +++ b/tests/Select.cpp @@ -50,6 +50,7 @@ int Select(int, char**) test::TabFoo f; test::TabBar t; + const auto tab_a = f.as(sqlpp::alias::a); getColumn(db, t.alpha); @@ -80,6 +81,11 @@ int Select(int, char**) std::cout << row.alpha << std::endl; } + for (const auto& row : db(select(all_of(t), all_of(f)).from(t.join(f).on(t.alpha > f.omega).join(tab_a).on(t.alpha == tab_a.omega)).where(true))) + { + std::cout << row.alpha << std::endl; + } + for (const auto& row : db(select(count(t.alpha), avg(t.alpha)).from(t).where(true))) { std::cout << row.count << std::endl;