From 29165b2ce3ed3c0c411cc4b48a64f56c635e7a1d Mon Sep 17 00:00:00 2001 From: Roland Bock Date: Sat, 5 Oct 2013 20:13:42 +0200 Subject: [PATCH] Removed obsolete flag in join types --- include/sqlpp11/join.h | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/include/sqlpp11/join.h b/include/sqlpp11/join.h index 4852c5c7..cd4690a2 100644 --- a/include/sqlpp11/join.h +++ b/include/sqlpp11/join.h @@ -34,22 +34,18 @@ namespace sqlpp { struct inner_join_t { - static constexpr bool _require_on = true; static constexpr const char* _name = " INNER "; }; struct outer_join_t { - static constexpr bool _require_on = true; static constexpr const char* _name = " OUTER "; }; struct left_outer_join_t { - static constexpr bool _require_on = true; static constexpr const char* _name = " LEFT OUTER "; }; struct right_outer_join_t { - static constexpr bool _require_on = true; static constexpr const char* _name = " RIGHT OUTER "; }; @@ -77,42 +73,43 @@ namespace sqlpp template join_t::type> join(T&& t) { - static_assert(not (JoinType::_require_on and is_noop::value), "join type requires on()"); + static_assert(not is_noop::value, "join type requires on()"); return { *this, std::forward(t) }; } template join_t::type> inner_join(T&& t) { - static_assert(not (JoinType::_require_on and is_noop::value), "join type requires on()"); + static_assert(not is_noop::value, "join type requires on()"); return { *this, std::forward(t) }; } template join_t::type> outer_join(T&& t) { - static_assert(not (JoinType::_require_on and is_noop::value), "join type requires on()"); + static_assert(not is_noop::value, "join type requires on()"); return { *this, std::forward(t) }; } template join_t::type> left_outer_join(T&& t) { - static_assert(not (JoinType::_require_on and is_noop::value), "join type requires on()"); + static_assert(not is_noop::value, "join type requires on()"); return { *this, std::forward(t) }; } template join_t::type> right_outer_join(T&& t) { - static_assert(not (JoinType::_require_on and is_noop::value), "join type requires on()"); + static_assert(not is_noop::value, "join type requires on()"); return { *this, std::forward(t) }; } template void serialize(std::ostream& os, Db& db) const { - static_assert(not (JoinType::_require_on and is_noop::value), "join type requires on()"); + // FIXME: Need to check if db supports the join type. e.g. sqlite does not support right outer or full outer join + static_assert(not is_noop::value, "joined tables require on()"); _lhs.serialize(os, db); os << JoinType::_name; os << " JOIN ";